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
{{ message }}
Repository navigation
Commit d4475f0
Browse filesBrowse the repository at this point in the historyBrowse files
fix(account-deletion): never purge objects that live data still names
Review of the durable storage sweep found ways it, or the in-memory purge it
backs up, could delete an object another tenant still uses.
Reference guard. Every account-deletion purge now runs one check before
deleting a key: the durable prefix sweep (per listed key), the durable
exact-key cleanup, and the post-commit in-memory purge. A key is kept when a
row still names it (workspace_files.key, workspace_file.key,
workspace_file_version.key, document.storage_key, execution_large_values.key)
or a stored asset URL names it: user.image, workspace.logo_url,
organization.logo, organization.whitelabel_settings, organization.metadata,
custom_block.icon_url, chat.customizations (deployed-chat logo and avatar) and
oauth_client.icon. URLs are mapped to keys with extractStorageKey, so serve
paths with or without a provider segment and direct bucket URLs both match;
over-matching only keeps an object. References embedded in free-form JSON or
text (workflow sub-block values, chat messages, Markdown links) are not
consulted; for the deleted account's own chat attachments that is the intended
erasure. This keeps whitelabel logos that were uploaded under an admin's
personal workspace prefix, and legacy kb/ objects shared across workspaces,
which the in-memory purge used to delete unchecked.
Exact-key cleanup also keeps any key under a workspace-keyed root whose
workspace still exists, since its members can read it by key through the
metadata fallback. Workspace-less rows are queued only for the Copilot
context: the workspace binding check was added NOT VALID, so legacy
shared-context rows without a workspace can name a surviving workspace's
object. Profile pictures are taken only from the account's own user.image,
never from rows, because whitelabel logos were once stored as
profile-pictures rows under an admin's account; organization logos are never
queued either.
Prefix deletion now counts only objects actually removed. A tolerated ENOENT
(locally, any file whose on-disk name no sanitized key resolves to) used to
count as progress, so a page of such files re-listed forever without spending
an attempt. The workspace sweep and the Project prefix cleanup (which had the
same flaw) now defer and spend an attempt when a full page removes nothing.
A local metadata sidecar is kept whenever its object is. Versions of the
account's private files are queued in keyset pages that stop at the cap
instead of one unbounded query inside the deletion transaction.
0 commit comments