Skip to content

fix(common): apply synced user groups after first load (PPT-2811) - #499

Open
MrYuion wants to merge 1 commit into
developfrom
fix/PPT-2811-user-group-sync
Open

MrYuion wants to merge 1 commit into
developfrom
fix/PPT-2811-user-group-sync

Conversation

@MrYuion

@MrYuion MrYuion commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

On first login, Workplace and Concierge act as if the user has no groups until they refresh. The SSO group sync adds the user's PlaceOS groups a few seconds after the app first loads the current user, so group-based booking rules and views use an empty group list.

Jira: PPT-2811

Fix

  • Load the current user again 2s and 10s after the first page is shown. The /- redirect page does not count. If User.groups changed, apply the new user and reload group permissions.
  • If the access guard sent the user to /unauthorised before the sync finished, send them back to the default route when their groups change.
  • Add a user_group_names signal that only changes when the set of groups changes. Group-based rules and views read it, so they update without a refresh:
    • available rooms (event form)
    • available desks, parking, lockers and assets (booking form)
    • desk and parking status on the explore map
    • the concierge sidebar
    • parking request options
    • caterers
  • When you book for yourself, the booking form now uses the current user for booking rules. Before, it used its own saved copy of the user, which could have the old groups.

Checks

  • nx test: common, bookings, events, explore, catering, concierge and workplace pass.
  • nx build: workplace and concierge pass.
  • New unit tests cover the group change check and the timing and access retry.

Recording

PPT-2811-user-group-sync.webm

This recording is from workplace in mock mode. A temporary mock change (not part of this PR) made users/current return only staff for the first 5.5 s. A local settings override made Desks and Parking require the engineering group. Home shows without Desks and Parking. About 2 s later, both appear without a refresh.


Changes made by Claude Opus 5.5 (1M context) in Claude Code.

🤖 Generated with Claude Code

The SSO group sync can finish a few seconds after the app loads the
current user, so a first login shows no group-based rules or views
until a refresh. Check the user's groups again 2s and 10s after the
first page is shown, and recompute group-based rules and views when
they change.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
frontend-templates Ignored Ignored Preview Sep 23, 2026 12:30am UTC

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant