feat(workspace): add member and deletion management - #147
Conversation
|
Reviewed this in full even though it is still a draft, so the feedback is waiting for you rather than the other way round. Not merging yet: it is a draft, and there are two data-integrity problems below that need fixing first. The authorization design itself is sound — more on that at the end. Blocking1. The 2. Post-commit storage and runtime cleanup is fire-and-forget with nothing to retry from. 3. The integration tests do not cover the permission matrix the description claims. Should fix, not blocking
What checks outRole checks are right on every endpoint: PATCH owner-only with the owner immutable; DELETE owner/admin with admin → member only, owner unremovable, self-removal 409; admin cannot invite admin; workspace delete is owner-only with an Not verified: in-flight daemon runs holding a runtime token for a deleted workspace, and Redis-held state (status leases, kanban timers, calendar dispatcher) keyed by the deleted company. Worth a paragraph in the description on what you expect there. Fix 1–3, mark it ready, and ping me. |
341627a to
2b91a12
Compare
Resolves the import-list conflict in src/api/client.ts with yetone#175 (DetectedEngine joins the sorted type import). Claude-Session: https://claude.ai/code/session_01SevbW9qCBbzrjfLMy14A31
|
Re-checked the fix commit against both blocking findings before merging:
Two things worth a follow-up, neither blocking:
Merging; ships in v0.14.0. |
Summary
Permissions
memberandadminWorkspace deletion
Workspace deletion runs tenant database cleanup in a transaction, covering both
FK-backed records and legacy soft-scoped tables. Referenced storage objects and
agent runtime resources are cleaned up after the transaction commits.
Testing
npm run buildnpm run typechecknpm run server:typechecknpm run lintnode --import tsx --test server/src/__tests__/db-schema-sentinels.test.tsAdded PostgreSQL integration coverage for: