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
refactor(dotcom): remove the groups_backend flag from production (tldraw#9418)
This is the next step in retiring the workspaces feature flags. It
removes `groups_backend` from production entirely — the logic that read
it, the value written to new users, and the now-dead migration tooling.
`groups_backend` is fully rolled out (every user is migrated and born
with a home workspace), so the legacy (`file_state`/`ownerId`-based)
branches it gated are dead, and new users no longer need it. Follows
tldraw#9405 and tldraw#9411 (the `groups_frontend` removal), both merged. Relates to
tldraw#8859.
**Preview deploy:** https://pr-9418-preview-deploy.tldraw.com/ — sign in
and exercise file/workspace flows (create, pin, open, remove, move,
accept invite) and the admin page. No flag setup needed; every account
is migrated.
### What changed
- Removed `isWorkspacesMigrated()` and collapsed every branch on it to
the migrated path: `mutators.ts` (`createFile`, `pinFile`/`unpinFile`,
`removeFileFromWorkspace`, `onEnterFile`) and `TldrawApp.ts`
(`getMyFiles`, `canCreateNewFile`, `isPinned`, `getFile`).
- Dropped the `assertUserHasFlag('groups_backend')` gates on the
workspace mutators.
- Removed the admin migrate-to-groups tooling (`/app/admin/user/migrate`
route + the `admin_migrateToGroups` durable-object method) and the
`acceptInvite` migration check.
- Stopped writing `groups_backend` at the three user-creation sites; new
users get `flags: ''`.
- Removed the redundant e2e groups-migration helpers (`migrateUser*`,
`isUserMigrated*`, `ensureGroupsReadyByEmail`) and their call sites.
Test users are born migrated via signup, so these were no-ops; the
`ensureGroupsReady` scenario helper keeps its navigation/sidebar setup,
only its migration call was dropped.
- Demoted `TlaFlags` to a `string` stub, keeping
`parseFlags`/`userHasFlag`/`hasFlag` so the next feature flag has
scaffolding.
### What's kept (deliberately)
- The `flags` column, the `TlaFlags` string stub, and
`parseFlags`/`userHasFlag`/`hasFlag` — retained so the next feature flag
has scaffolding (no schema migration needed).
- The `migrate_user_to_groups` SQL function. It lives in an applied
(immutable) migration and is now uncalled, so it stays as frozen
history.
- Dropping the `flags` column itself (a Postgres + Zero schema change)
is intentionally out of scope — we're keeping the column for future
flags.
### Decisions worth a reviewer's eye
- **Access control is intentionally untouched.**
`assertUserCanAccessFile` / `canUpdateFile` branch on the *file's* shape
(`ownerId` vs `owningGroupId`), not on the flag, so they're kept as
defensive fallbacks for any legacy `ownerId` files. We stop *producing*
legacy files but keep *tolerating* them.
- **New users get `flags: ''`.** Existing users' stored `groups_backend`
value is harmless — nothing reads it after this PR.
- **`assertNotMaxFiles` removed.** This server-side `createFile` limit
only ran on the legacy path and was already inert for migrated users;
the client-side limit in `canCreateNewFile` remains. If a
server-enforced per-workspace cap is wanted, that's a separate feature.
### Change type
- [x] `other` (internal refactor, no user-facing change)
### Test plan
1. On the preview deploy, sign in and confirm normal file/workspace
flows work: create, pin/unpin, open, remove, move between workspaces,
accept an invite.
2. Confirm the admin page loads with the "migrate user" action gone
(other sections intact).
- [x] Unit tests
- [x] End to end tests
### Code changes
| Section | LOC change |
| --------- | ---------- |
| Core code | +45 / -171 |
| Tests | +6 / -81 |
| Apps | +22 / -174 |
0 commit comments