mirror of
https://github.com/stablyai/orca.git
synced 2026-10-23 16:03:49 +00:00
chore(workspace-cleanup): tighten hydration guard rationale
This commit is contained in:
@@ -18,9 +18,7 @@ describe('workspace cleanup browse hydration', () => {
|
||||
})
|
||||
|
||||
it('does not let a sync broadcast revert a filter the user just set', () => {
|
||||
// The browse writer debounces 250ms, so any other ui.set inside that window
|
||||
// broadcasts state that still holds the previous filters. Re-hydrating it here
|
||||
// reverted the edit, and the pending debounce then persisted the revert.
|
||||
// Other ui.set broadcasts carry stale browse state until its debounced writer runs.
|
||||
const store = createUIStore()
|
||||
store.getState().hydratePersistedUI(persistedWithIdleDays(30), 'startup')
|
||||
|
||||
|
||||
@@ -2625,11 +2625,7 @@ export const createUISlice: StateCreator<AppState, [], [], UISlice> = (set, get)
|
||||
// Why the normalizer rather than a cast: this blob is hand-editable and
|
||||
// may come from an older or newer build; it degrades field by field
|
||||
// instead of bricking the cleanup dialog.
|
||||
// Why startup-only, like activeView below: the browse writer debounces 250ms, so
|
||||
// any other ui.set inside that window broadcasts state still holding the previous
|
||||
// filters. Re-hydrating it here reverted the edit, and the pending debounce then
|
||||
// persisted the revert. Nothing else edits browse state (mobile has no cleanup
|
||||
// consumer, the popout is a separate store), so filters are per-window.
|
||||
// Why: a sync broadcast can carry stale browse state while its writer is debounced.
|
||||
workspaceCleanupBrowse:
|
||||
source === 'startup'
|
||||
? normalizeWorkspaceCleanupBrowseState(ui.workspaceCleanup?.browse)
|
||||
|
||||
Reference in New Issue
Block a user