fix(task-board): retire a drag override when its card leaves the list - #6950
Closed
pedrofrxncx wants to merge 1 commit into
Closed
fix(task-board): retire a drag override when its card leaves the list#6950pedrofrxncx wants to merge 1 commit into
pedrofrxncx wants to merge 1 commit into
Conversation
Collaborator
Author
|
Closing as stale: this PR sat past the bot's 48h merge window, main has moved on, and its CI results no longer reflect the current base. This is a housekeeping close, not a rejection of the change — if the underlying problem still exists, the bot will find it again and open a fresh, rebased PR. [studio-bot:stale-close] |
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.
Bug.
Lanes' render-time override-retirement loop (apps/web/src/layouts/task-board/index.tsx) only removes a card's drag-placement override from theoverridesMap once the server's copy of that card reports the same status/sortOrder. If the card instead leavesitems(the already filter-narrowedvisibleItems— deleted, archived, or filtered out by an assignee/project change while the drop's optimistic patch hadn't landed yet),items.find(...)returnsundefined, the equality check can never pass, and the override sits in the Map forever. Each such drop leaks one entry for the rest of the session.Why it matters: on a long-lived board session with routine drags + filter changes, this Map only grows — a real (if slow) memory leak in a component that stays mounted for the life of the tab.
Fix: treat a card missing from
itemsas settled too (nothing left to preview/bridge for it), so its override is dropped in the same retirement pass.How to verify:
bunx tsc --noEmitin apps/web (clean) andbunx oxlint apps/web/src/layouts/task-board/index.tsx(0 warnings/errors) — both run locally. No behavior change for the normal settle path (still requires status+sortOrder match when the card is present); full CI covers the rest.Summary by cubic
Fixes a memory leak in the task board where drag placement overrides stayed in the
overridesMap forever after a card left the visible list (deleted, archived, or filtered out). The retirement pass now treats a missing card as settled, so its override is dropped in the same pass. No behavior change for visible cards; they still require status and sort order to match.Written for commit bde1035. Summary will update on new commits.