Repository navigation
fix: ルール名の打ち直し中のタブイベントとの競合でグループの改名がスキップされるのを直す - #113
Merged
Merged
Conversation
regroupTab はタブイベントの判定し直しのたびに、titlesStore へ「ルールが今持つべきタイトル」 (currentTitles)を記録していた。この記録は有効なルールのタイトルを常にルールの今の名前で 上書きするため、ルール名の変更の反映(applyRuleChange)がまだ実行されていない間にタブイベントが 先に発火すると、記録だけが新しい名前に先回りしてしまい、後から来る反映処理が「変更済み」と 誤認して実際のグループの改名を永久にスキップしてしまっていた。 currentTitles を titlesForNewRules に置き換え、まだ記録に無いルールの分だけタイトルを足し、 記録済みのルールのタイトルは上書きしないようにした。Issue #36 が防ぎたかった「タブイベントが 先にグループを作った場合に記録から漏れる」ケースはそのまま救い、競合でスキップされるケースだけを止める。 Closes #110 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
ルールの名前(グループ名)を変えたとき、まれに実際のタブグループの名前が変わらないまま残る不具合を直す。
関連Issue
Closes #110
関連ADR
なし
変更内容
regroupTab(entrypoints/background/grouping.ts)がタブイベントの判定し直しのたびにtitlesStoreへ書いていたcurrentTitlesをtitlesForNewRules(utils/grouping/rule-change.ts)に置き換えたcurrentTitlesは有効なルールのタイトルを常にルールの今の名前で上書きしていたため、ルール名の変更の反映(applyRuleChange)がまだ実行されていない間にタブイベントが先に発火すると、記録だけが新しい名前に先回りしてしまい、後から来る反映処理が「変更済み」と誤認して実際のグループの改名を永久にスキップしてしまっていたtitlesForNewRulesはまだ記録に無いルールの分だけタイトルを足し、記録済みのルールのタイトルは上書きしない。Issue ルールの変更のデバウンス中に作られたグループの名前・色が反映されない #36 が防ぎたかった「タブイベントが先にグループを作った場合に記録から漏れる」ケースはそのまま救い、競合でスキップされるケースだけを止めるentrypoints/background/grouping.test.ts・utils/grouping/titles-for-new-rules.test.ts)確認方法
pnpm testで単体テストが通ることを確認(entrypoints/background/grouping.test.tsの新しいテストは、修正前のコードに戻すと失敗する)nix develop .#e2e --command bash -c 'pnpm build'の後、taskset -c 0 pnpm exec playwright test -c e2e --workers=1 -g "グループ名を打ち直す|ほかのルールの名前を通って打ち直す|名前を入れ替える" --repeat-each=40を実行し、Issue本文の再現手順(1コアに制限した環境で高頻度に失敗する)が解消していることを確認(実行済み: 120件×3回、全件成功)チェックリスト
nix flake checkとprek run --all-filesが通るdocs/adr/に ADR を追加した(今回は不要)