You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After the in-flight write completes, the replacement registration does not converge to the value that is already on disk and in the settings document.
Expected behavior
After the in-flight write reaches storage, the current owner of the namespace should be resolved from that persisted section, so runtime state, describe(), and storage agree.
Root cause
After await this.persist(ns, section), the document cache is updated unconditionally, but the commit is skipped when the namespace owner changed. The replacement registration is not re-resolved:
This can be particularly persistent for a file-backed provider if its watcher suppresses the process's own write event.
Suggested fix
After persistence, re-resolve and commit the current registration when it differs from the original registration, or serialize namespace replacement behind pending writes. A regression test should delay persist(), replace the registration, then assert that the replacement receives the persisted value.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Summary
A settings namespace can remain indefinitely stale when it is re-registered while the previous registration's write is waiting for
persist().Tested on
masterat commit47f943859bef60e4160492346772ded9b24f765a.Reproduction
{ "theme": "dark" }.{ "theme": "light" }with a settings provider whosepersist()is delayed.describe(), and the replacement registration.Observed result:
After the in-flight write completes, the replacement registration does not converge to the value that is already on disk and in the settings document.
Expected behavior
After the in-flight write reaches storage, the current owner of the namespace should be resolved from that persisted section, so runtime state,
describe(), and storage agree.Root cause
After
await this.persist(ns, section), the document cache is updated unconditionally, but the commit is skipped when the namespace owner changed. The replacement registration is not re-resolved:deepseek-harness/packages/settings/settings/src/index.ts
Lines 634 to 643 in 47f9438
This can be particularly persistent for a file-backed provider if its watcher suppresses the process's own write event.
Suggested fix
After persistence, re-resolve and commit the current registration when it differs from the original registration, or serialize namespace replacement behind pending writes. A regression test should delay
persist(), replace the registration, then assert that the replacement receives the persisted value.All reactions