Rollback replays prior settings into sibling overlays even when the record restore is skipped

オープン
#2,494 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 3 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
28/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
typescript
領域
backend

調査の方向性

Start in src/extension/api.ts at the setConfiguration compensation: record restore guarded by recordStillOurs (797/810/814), unconditional shared mode/pin restore (833-836), and unconditional sibling overlay replay using previousSettings ?? {} (849-853). Read that compensation path and issue #2488 step 2 before changing code; the minimal interim is to gate the overlay replay on recordStillOurs. Done means a skipped record restore no longer writes prior settings onto sibling overlays, covered by a test for the later-write-wins scenario.

索引モデルが issue の本文から書いたものです。

説明

Found while answering review thread 4609481469 on PR #1560, and verified in the file before agreeing to it.

Amendment, provenance and a sibling-site note only: one authored change applied in two writes, 06:34:35Z and 06:34:45Z, the second adding only the blank line between the lead-in sentence and its three bullets that the first collapsed. The claim, the three bullets and the interim option paragraph below are byte-for-byte unchanged.

The line numbers below were read on branch vps2/f3-mode-profile-writes at head 57b766b2f4977b6988b263efd81963680b050b9b. src/extension/api.ts is byte-identical between b75156dcd0, the head this issue was filed against, and that head - the diff for that file between the two is empty - so the anchors are valid for both. The same numbers in the sibling lane name unrelated code, which is why the head is named.

The setConfiguration compensation decides three things separately:

  • the profile record restore is conditional: api.ts line 797 runs it only while recordStillOurs holds, line 810 logs leaving the record alone when the store could not be re-read, and line 814 logs skipping the restore when the store no longer holds this call's write.
  • the shared mode and pin restore at lines 833 to 836 is unconditional.
  • the sibling overlay replay at lines 849 to 853 is unconditional and passes previousSettings ?? {}.

So when the record restore is skipped because a later write owns the record, the overlays pinned to that profile are still set to the prior settings while the record keeps the newer content that caused the skip. The overlays then describe a snapshot the record has moved past, and the next postStateToWebview or task creation on those views pairs a current name with superseded settings.

This is the same weakness as step 2 of issue #2488 seen from the overlay side: a comparison on values cannot tell this compensation's write from a later identical one, so it cannot tell whether the replay still owns the overlay it is writing. The durable close is the record-level write revision, not an extra comparison here.

Not changed on PR #1560: this head's production change is the mode-vs-settings supersession in loadViewState, and adding a second production change here would reopen the compare-and-set contract answers that PR has already published. A minimal interim option, if one is wanted before step 2, is to gate the overlay replay on recordStillOurs so a skipped restore does not overwrite sibling overlays with a stale snapshot.

Counterpart in the sibling branch, recorded here so a maintainer does not have to rediscover it: in wt-fix1562 at 7c7556b18b the same unconditional sibling replay sits at src/extension/api.ts lines 1011 to 1015, and its record restore is guarded differently - inside manager.runExclusiveAcrossInstances at 900, comparing the stored record against savedSettings at 907 to 909, with the rollback replay filtered to writtenKeys at 960 to 962 under the comment that begins at 955 - so the weakness is one class with two shapes, and the durable close is still step 2 of issue #2488. recordStillOurs does not occur in that file at that head; it occurs twice in this lane's file.

主要言語
TypeScript
スター
2k
フォーク
301
平均マージ
3日 14時間
マージ済み PR(30日)
103

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Zoo-Code-Org/Zoo-Code のほかの issue

Zoo-Code-Org/Zoo-Code の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。