Repository navigation
refactor(frontend): route refresh-work-items through one reconciliation (WI-1924) - #435
Merged
Merged
Conversation
…on (WI-1924) Seven surfaces listened to the global refresh-work-items broadcast independently, so one mutation started several unrelated reads: the homepage snapshot, the item SLA panel, every SLA badge, child items and the collection delta. The SLA panel also bypassed slaState and issued its own per-item read, duplicating the workspace batch the badges already use. Add a workItemRefresh coordinator that owns the single listener, merges a burst into one notification, and notifies each subscriber once. Migrate the homepage lifecycle, homepage, item detail, collection views, SLA panel and SLA badge to subscribe to it. The panel now reads through slaState so it shares the workspace batch with badges, and both skip a burst that names another workspace. Cache invalidation stays a synchronous window listener in slaState so the cache is cleared before the debounced subscribers reload.
|
Size Change: 0 B 🆕 Total Size: 0 B |
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.
Why
The global
refresh-work-itemsbroadcast had seven independent window listeners, so one mutation started several unrelated reads:slaStatewith a directsla.getItemSLAThe panel's direct read duplicated the workspace batch the badges already use, and every badge refetched on any burst regardless of workspace.
What
New
stores/workItemRefresh.js— owns the singlerefresh-work-itemslistener, merges a burst into one notification (accumulating every item/parent id), and notifies each subscriber once. ExposesonWorkItemRefresh,workItemRefreshTouchesWorkspace, and a test-only reset.Migrated to subscribe: homepage lifecycle, Homepage, ItemDetail, CollectionList/Board/Backlog, ItemSLAPanel, SLABadge. The only remaining raw listener is
slaState's synchronous cache clear, so the cache is invalidated before the debounced subscribers reload.SLA surface:
ItemSLAPanelnow reads throughslaState.getItemSLA(itemId, workspaceId)(it getsworkspaceIdfromItemDetailSidebar), so the panel and badges share one batch per workspace. Both skip a burst that names another workspace.Result
Verification
bun run check,bun run typecheck— pass../core-testsfrontend suite — 437 files, 3268 tests passPairs with Windshiftapp/core-tests-internal#33.