fix(tables): clear row selection when the visible rows change - #3182
Merged
Conversation
Selection state in MultiSelectionTable stuck around across pagination and search, keyed only on row id. Selecting rows, then paginating to a different page and hitting "select all" would carry the old ids into the new batch delete, silently deleting rows the user never saw selected. Reported from Storage and Databases in production. Reset selection whenever the URL changes, and key the previously unkeyed row each-blocks (files, users, memberships, platforms, backups) so Svelte doesn't reuse row elements across renders.
Console (appwrite/console)Project ID: Tip Roll back Sites deployments instantly by switching between versions |
Contributor
Greptile SummaryThe PR resets multi-table selection when the active URL changes and keys table rows by stable resource IDs to prevent stale selections from carrying across visible datasets.
Confidence Score: 5/5The PR appears safe to merge because no blocking failure remains. No blocking failure remains. Important Files Changed
Reviews (2): Last reviewed commit: "revert: drop the new component-test scaf..." | Re-trigger Greptile |
This repo has no existing Svelte component test pattern, so covering the fix meant inventing one from scratch: jsdom localStorage/ ResizeObserver shims plus a harness component, none of which serves anything else here. Not warranted for a bug fix. The fix itself (selection reset on URL change + keyed row loops) stands on its own.
ChiragAgg5k
approved these changes
Aug 24, 2026
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.

The bug: row selection in
MultiSelectionTablewas keyed to a staticcomputeKey, not to which rows were actually on screen. Select some rows, paginate (or search) to a different set, and the old ids stayed selected. Hitting "select all" + delete on the new page then deleted rows the user never saw checked — reported from both Storage and Databases, including one case of file loss that needed manual recovery.Fix: selection now clears whenever the URL changes (
page.url.href— covers pagination, search, filters), via an$effect.preinmultiSelectTable.svelte. Also keyed five previously-unkeyed{#each}row blocks (bucket files, users, memberships, platforms, backups) so Svelte doesn't reuse row DOM across renders with stale identity — a second, independent path to the same bug.The clear is deliberately scoped to URL changes rather than
computeKeychanges: keying it oncomputeKeywould also wipe the selection mid-flow after a partial delete failure, leaving the confirm dialog reporting 0 rows.Test plan
format,check(0 errors),lint(0 errors),test:unit(265 passing),buildall clean