René's URL Explorer Experiment


Title: fix(realtime): enforce room access continuously, not only at join by waleedlatif1 · Pull Request #6170 · simstudioai/sim · GitHub

Open Graph Title: fix(realtime): enforce room access continuously, not only at join by waleedlatif1 · Pull Request #6170 · simstudioai/sim

X Title: fix(realtime): enforce room access continuously, not only at join by waleedlatif1 · Pull Request #6170 · simstudioai/sim

Description: Summary File-doc, table, and workspace-list rooms were authorized once at JOIN and never again — a member whose workspace access was revoked or downgraded kept live collaborative write access (including durable Yjs document writes) for the whole lifetime of an already-open socket. The access-revalidation sweep explicitly skipped every non-workflow room; only workflow rooms were continuously authorized. Sweep every room type now, authorizing each against its own resource (type:id decodes to the right workspace) instead of skipping anything that isn't a workflow. One shared membership policy (ROOM_MEMBERSHIP_ACTIONS in a new dependency-free @sim/platform-authz/room-policy) backs both the join check and the sweep, so a file-doc room keeps requiring write in both and the two can't drift. That also makes a downgrade (write → read) evict from the editor while keeping the table room. Per-frame gates on the hot paths: file-doc document frames and table cell selections check the cached permission synchronously (no DB wait per keystroke) and evict on a confirmed loss of access — dropping the room binding that gates the writes. Re-check the cached decision immediately before a join commits, so a join that authorized just before a revocation can't re-enter the room the sweep just evicted it from. A join's own cache write can no longer clobber a revocation recorded while its query was in flight (entry-identity guard, mirroring the resolver's existing in-flight guard). New room-access-revoked event for non-workflow rooms; the file-doc client latches it as fatal and falls back to the read-only view instead of accepting keystrokes that go nowhere. Workflow's existing access-revoked payload is untouched. Eviction stays fail-open on uncertainty: only a definitively-resolved insufficient permission evicts, so a DB blip or a hung query never kicks a live collaborator (the cold-cache fallback is now the room's own required level, not a static read that would have evicted every file-doc socket). Type of Change Bug fix (security) Testing 259 realtime tests + 43 client collaboration tests pass; tsc clean for apps/realtime, apps/sim, and both touched packages; biome clean; check-monorepo-boundaries and check-realtime-prune-graph pass. Each of the 10 new tests was verified to fail with its guard removed. Not live-tested with two browsers / two principals — the revocation half is covered by unit tests, not a live session. Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing No new warnings introduced I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Open Graph Description: Summary File-doc, table, and workspace-list rooms were authorized once at JOIN and never again — a member whose workspace access was revoked or downgraded kept live collaborative write access (inc...

X Description: Summary File-doc, table, and workspace-list rooms were authorized once at JOIN and never again — a member whose workspace access was revoked or downgraded kept live collaborative write access (inc...

Opengraph URL: https://github.com/simstudioai/sim/pull/6170

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:2aa22353-c03b-573d-848c-1647adf48b73
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idB0F0:2D7CAE:5ECD15:86C510:6AFB43F9
html-safe-nonceebbd88b33efdde856c4c4321a9841462a4c3d6161b2ab25b11fc1de65700cc52
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMEYwOjJEN0NBRTo1RUNEMTU6ODZDNTEwOjZBRkI0M0Y5IiwidmlzaXRvcl9pZCI6IjM4MzkzNjg4MDYzOTY1NDM5OTMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac2f74592e9a1474fa4e6116711dd0cd01e66645da19247da0f8bac79f56943467
hovercard-subject-tagpull_request:4185157945
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/6170/files
twitter:imagehttps://avatars.githubusercontent.com/u/40672544?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/40672544?s=400&v=4
og:image:altSummary File-doc, table, and workspace-list rooms were authorized once at JOIN and never again — a member whose workspace access was revoked or downgraded kept live collaborative write access (inc...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noned849b928f455c800985398e7f1b659425adb312a5fa14fba5d9a14e62e9fe5dd
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/simstudioai/sim git https://github.com/simstudioai/sim.git
octolytics-dimension-user_id199344406
octolytics-dimension-user_loginsimstudioai
octolytics-dimension-repository_id912559512
octolytics-dimension-repository_nwosimstudioai/sim
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id912559512
octolytics-dimension-repository_network_root_nwosimstudioai/sim
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasea6c2f87cbcb6414452377b4967858ed6a66f1109
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/6170/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F6170%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F6170%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=simstudioai%2Fsim
Reloadhttps://github.com/simstudioai/sim/pull/6170/files
Reloadhttps://github.com/simstudioai/sim/pull/6170/files
Reloadhttps://github.com/simstudioai/sim/pull/6170/files
simstudioaihttps://github.com/simstudioai
simhttps://github.com/simstudioai/sim
Codehttps://github.com/simstudioai/sim
Issues129 (129)https://github.com/simstudioai/sim/issues
Pull requests200 (200)https://github.com/simstudioai/sim/pulls
Actionshttps://github.com/simstudioai/sim/actions
Projectshttps://github.com/simstudioai/sim/projects
Security and qualityhttps://github.com/simstudioai/sim/security
Insightshttps://github.com/simstudioai/sim/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
waleedlatif1https://github.com/waleedlatif1
staginghttps://github.com/simstudioai/sim/tree/staging
worktree-realtime-room-authzhttps://github.com/simstudioai/sim/tree/worktree-realtime-room-authz
Conversation 38 https://github.com/simstudioai/sim/pull/6170
Commits 11 https://github.com/simstudioai/sim/pull/6170/commits
Checks 27 https://github.com/simstudioai/sim/pull/6170/checks
Files changed https://github.com/simstudioai/sim/pull/6170/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6170/files
fix(realtime): enforce room access continuously, not only at join https://github.com/simstudioai/sim/pull/6170/files#top
Show all changes 11 commits https://github.com/simstudioai/sim/pull/6170/files
498f38b fix(realtime): enforce room access continuously, not only at join waleedlatif1 Aug 1, 2026 https://github.com/simstudioai/sim/pull/6170/commits/498f38b680c0d19770689677dd4f6c7c5ba543f2
553d1aa refactor(realtime): one shared eviction path for revoked room access waleedlatif1 Aug 1, 2026 https://github.com/simstudioai/sim/pull/6170/commits/553d1aa4c3dd60f665530c9ca029bcd38f3f3bd1
28192ff fix(realtime): re-check access before workspace-list room joins too waleedlatif1 Aug 1, 2026 https://github.com/simstudioai/sim/pull/6170/commits/28192ff2e5f301014ad3df7f426b8f7803e3f0d6
950d8a0 fix(realtime): order role-cache writes by read start, not write time waleedlatif1 Aug 1, 2026 https://github.com/simstudioai/sim/pull/6170/commits/950d8a0b0fc1cb72076586351d1c6eab2c8b428c
98d82bd chore(realtime): drop the test-only unguarded role-cache writer waleedlatif1 Aug 1, 2026 https://github.com/simstudioai/sim/pull/6170/commits/98d82bdbbe50b238e5e574156efeb599da98ea4b
1086dc3 fix(realtime): keep handler-initiated table eviction retryable waleedlatif1 Aug 1, 2026 https://github.com/simstudioai/sim/pull/6170/commits/1086dc31117e033a71f30a09c069dbfc5ef858d3
7323300 fix(realtime): re-resolve access at join commit instead of peeking th… waleedlatif1 Aug 1, 2026 https://github.com/simstudioai/sim/pull/6170/commits/7323300ae2d15816ee79a78aac03b8a1e5bd3ca0
f7d6387 fix(realtime): keep the join generation guard after the access re-check waleedlatif1 Aug 1, 2026 https://github.com/simstudioai/sim/pull/6170/commits/f7d63875c01b95f583c13c59cd3fc249d45ada00
2dc2d59 test(realtime): use the shared sleep helper in the new join tests waleedlatif1 Aug 2, 2026 https://github.com/simstudioai/sim/pull/6170/commits/2dc2d59e8d849c5427fde389b4a599c9c0526766
9b52f63 fix(realtime): leave the prior table room only once the join is certain waleedlatif1 Aug 2, 2026 https://github.com/simstudioai/sim/pull/6170/commits/9b52f631412f70104e4f7a07305318d20c6df21c
54fdd4f fix(realtime): close the table join window between re-check and commit waleedlatif1 Aug 2, 2026 https://github.com/simstudioai/sim/pull/6170/commits/54fdd4f07fce35b5aea3d334ada8361b2fcd3033
Clear filters https://github.com/simstudioai/sim/pull/6170/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6170/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6170/files
access-revalidation.test.ts https://github.com/simstudioai/sim/pull/6170/files#diff-d68660f5845944c67a91771806fe917d9c0c183cd7833e1ea4b5e00fc82c0c28
access-revalidation.ts https://github.com/simstudioai/sim/pull/6170/files#diff-09c3a2d548ed8aaa678551a5ed8b14ecc1ac86a06b3e3da5bb001d8d43de1cba
file-doc.test.ts https://github.com/simstudioai/sim/pull/6170/files#diff-e5340b7461b8def251df0b8bcc90796d84ac1296310a7be1230cd374551aae77
file-doc.ts https://github.com/simstudioai/sim/pull/6170/files#diff-d3588b9954ee6e449255c053a6b579f4f687e6afa4ed18f60ab53077ad8411c8
room-eviction.ts https://github.com/simstudioai/sim/pull/6170/files#diff-d176deaa4d9604a06df55894bfdfae94ee644436f49013fcdae65fa92dd3977c
room-join-auth.ts https://github.com/simstudioai/sim/pull/6170/files#diff-8969818a590046b9e2947700419ff131ce84ff14b99b574395acf873a288ea21
tables.test.ts https://github.com/simstudioai/sim/pull/6170/files#diff-7380acf3cf859e96f0d7311c038ba0a0e021b8751418c11effa22c880b75ce92
tables.ts https://github.com/simstudioai/sim/pull/6170/files#diff-00b228ce8901bae9761e81272e244e9746ef76267178fed37fbb35eb2d81aa43
workspace-invalidation-room.test.ts https://github.com/simstudioai/sim/pull/6170/files#diff-3631d0d5323ba97cfe93d6bbb2c915d2518b0735050ebcefc6d3a6b2978d4a0d
workspace-invalidation-room.ts https://github.com/simstudioai/sim/pull/6170/files#diff-843d6c3ba65fc2178d551b9186b2a27656ee6135be2cf762599a6d1103b6ae08
permissions.test.ts https://github.com/simstudioai/sim/pull/6170/files#diff-df8569942debacaacf33092a1ceb70e82fe44eea791fdbf8ed591ad32c9776ac
permissions.ts https://github.com/simstudioai/sim/pull/6170/files#diff-fe5f280efeac435d7aad7d310560421ad87b21af62233547c3ec3ca19a5967d8
file-doc-provider.ts https://github.com/simstudioai/sim/pull/6170/files#diff-598531064700e61a529706f022aa7de5653fea72bca2dfd7a0ca6ab621a666b2
package.json https://github.com/simstudioai/sim/pull/6170/files#diff-211a9368220560f569e47c490481bd2612a86e7efe8af72363d66984b5c4fde5
predicates.ts https://github.com/simstudioai/sim/pull/6170/files#diff-d218ba5650ac88fc6d382b19d269ce091cf735c7df3d4efa094c8597d58925c1
room-policy.ts https://github.com/simstudioai/sim/pull/6170/files#diff-2ef9ca300682a663ac29de066ceb5379d5a4e6f67c070621a3b5a8e041885ee6
events.ts https://github.com/simstudioai/sim/pull/6170/files#diff-3ac6c4579ad1d8340d46b1e84df94b24336fccd884c1dd117ec5d637beb0abd3
apps/realtime/src/access-revalidation.test.tshttps://github.com/simstudioai/sim/pull/6170/files#diff-d68660f5845944c67a91771806fe917d9c0c183cd7833e1ea4b5e00fc82c0c28
View file https://github.com/simstudioai/sim/blob/54fdd4f07fce35b5aea3d334ada8361b2fcd3033/apps/realtime/src/access-revalidation.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6170/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6170/files#diff-d68660f5845944c67a91771806fe917d9c0c183cd7833e1ea4b5e00fc82c0c28
https://github.com/simstudioai/sim/pull/6170/files#diff-d68660f5845944c67a91771806fe917d9c0c183cd7833e1ea4b5e00fc82c0c28
https://github.com/simstudioai/sim/pull/6170/files#diff-d68660f5845944c67a91771806fe917d9c0c183cd7833e1ea4b5e00fc82c0c28
https://github.com/simstudioai/sim/pull/6170/files#diff-d68660f5845944c67a91771806fe917d9c0c183cd7833e1ea4b5e00fc82c0c28
https://github.com/simstudioai/sim/pull/6170/files#diff-d68660f5845944c67a91771806fe917d9c0c183cd7833e1ea4b5e00fc82c0c28
Please reload this pagehttps://github.com/simstudioai/sim/pull/6170/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6170/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.