Fixes and improvements#583
Conversation
- Hide "Recently approved" badge on free workspaces (auto-created, not approved) - Cap workspace card avatars at 3 + overflow bubble so busy workspaces don't overflow the card - Exclude free-tier workspaces from non-admin discovery and reject access requests against them - Hide "New organisation workspace" button and "Project Defaults" settings for users with no org membership
The Columns dropdown and period selector on /admin/usage-and-billing
appeared inert — checkbox toggles and "Last month" clicks fired and
even refetched, but the table never reflected them.
Two bugs stacked:
1. Menu.Item's onClick called preventDefault(), which swallowed the
bubbled checkbox click and stopped the toggle (same root cause as
the org-usage fix in 0ba5830).
2. React Compiler memoized BillingTable's JSX on [footerTotals, table].
TanStack's useReactTable returns a stable reference and mutates the
table in place, so the cache always hit and state changes never
reached the DOM. SimpleDataTable had the same latent issue affecting
Partners / Upgrades sort + search.
…request path
Submit and approve/deny were doing N sequential Directus notification
writes plus a synchronous SendGrid send inline, adding 5–7s of click
latency. Schedule them via FastAPI BackgroundTasks so the response
returns immediately. Also drop the redundant workspace re-fetch in
_notify_requester_approved by threading the name through from the
caller (_upgrade_workspace_for_request now returns (id, name)).
Same test surface; affected suite runtime drops from ~71s to ~1.4s,
mirroring the production speedup.
Five files changed:
- server/dembrane/api/v2/workspace_requests.py — extract staff fan-out into _notify_staff_workspace_request_submitted, schedule via BackgroundTasks.
- server/dembrane/api/v2/admin.py — BackgroundTasks on decide_workspace_request; background-schedule both notify helpers; drop redundant get_item("workspace", …); _upgrade_workspace_for_request returns (id,
name).
- server/tests/test_workspace_requests.py, server/tests/test_approve_deny_action.py, server/tests/test_request_notifications.py — pass BackgroundTasks(), drain queue where assertions check side-effects,
adjust the tuple-return assertion + drop now-unused workspace mocks.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (10)
WalkthroughThis PR implements free-tier workspace restrictions and refactors notification handling to async BackgroundTasks. Backend endpoints now filter free-tier workspaces from discovery and block direct access requests. Notifications for both staff submissions and requester approvals are scheduled asynchronously. Frontend UI is gated by user access level and workspace tier, preventing low-access users from accessing certain features. ChangesWorkspace Access Control and Async Notifications
🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
fix: repair regressions from sidebar PR (#585) The sidebar PR overlapped with #577, #581, #582, and #583 and introduced a few cross-cutting issues this commit addresses: - Restore the "hide Project defaults for external-only users" gate in the new sidebar's UserSettingsView. PR #582/#583 added this filter to the old UserSettingsRoute; when the sidebar moved navigation into a new view component, the NavItem rendered unconditionally and external-only users could click through to an empty pane. - Drop schema-step tests that imported the deleted scripts/create_schema.py one-shot seeding script. The committed snapshot under directus/sync/snapshot/ is the source of truth now, so those structural guards were checking a script that no longer exists. - Update AGENTS.md to remove the create_schema.py reference and point at the snapshot directory. - Populate ref_workspace_id on PROJECT_SHARE_ROLE_CHANGED (project_sharing.py), REPORT_READY, and REPORT_FAILED (tasks.py). The new useNotifications href builder requires both ref_workspace_id and ref_project_id to produce /w/{ws}/projects/... links; without it those notifications rendered as dead clicks. - Strip the per-request org_membership lookup in get_workspace_context. PR #582 enforces role='external' ⟺ no org_membership at every write path, and on_organisation_member_removed cascades workspace_membership soft-deletes correctly, so the read-side normalisation was redundant per-request DB overhead. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * User settings view now fetches and displays workspace access information, conditionally showing relevant configuration options based on access level. * Notifications for project sharing and report status now include workspace context information for better organization. * **Documentation** * Updated deployment guide with clarified schema snapshot and migration script procedures. * **Tests** * Removed legacy schema step validation tests from test suite. <!-- review_stack_entry_start --> [](https://app.coderabbit.ai/change-stack/Dembrane/echo/pull/586?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) <!-- review_stack_entry_end --> <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Summary by CodeRabbit
Release Notes
Bug Fixes
Changes