René's URL Explorer Experiment


Title: fix(files,realtime): issue a revision on revert and stop resurrecting cleared cursors by waleedlatif1 · Pull Request #8098 · simstudioai/sim · GitHub

Open Graph Title: fix(files,realtime): issue a revision on revert and stop resurrecting cleared cursors by waleedlatif1 · Pull Request #8098 · simstudioai/sim

X Title: fix(files,realtime): issue a revision on revert and stop resurrecting cleared cursors by waleedlatif1 · Pull Request #8098 · simstudioai/sim

Description: Summary Follow-ups to the review findings on #8096. Ten findings were raised there; I investigated each one. Three were real and are fixed here, seven were not and were dismissed on the threads. Fixed Revert now issues a revision. POST /api/v2/files/:id/versions/:version/revert accepts expectedRevision and invalidates it by succeeding, but was the only v2 file write that didn't return the replacement. Callers had to re-read metadata to chain a second conditional write — and the gap between the revert and that read reopens exactly the TOCTOU window the revision exists to close. Cleared cursors stop coming back. The presence roster merge coalesced cursor with ??. The fallback is load-bearing — the realtime server rebuilds a socket's presence record on join, so a re-join broadcasts a roster with cursor omitted, and blanking it would flicker peers' pointers. But an explicit null is a pointer the peer cleared on leaving the canvas, and treating it as absent re-pinned a ghost cursor whenever the clearing cursor-update was missed (dropped by the visibility gate during a join, or by a rejoin that never refreshed the roster). Now undefined keeps, null clears. selection is untouched — a cleared selection is {type:'none'} and that wire type admits no null. Pulled the merge out to socket-presence-merge.ts so it's testable, matching the sibling socket-join-target.ts / socket-join-controller.ts pattern. Two File block output descriptions named operations the block doesn't have. revision claimed a get operation — this block has Get Content, which emits no revision — and lineCount named insert, which is an edit mode under Apply Edit, not an operation. Also collapses the five hand-rolled copies of the revision conditional spread into workspaceFileRevisionField, beside the token whose omission contract it encodes. That includes the private revisionField the internal file surface had already extracted for itself. Investigated and dismissed (details on each thread in #8096) Compose POSTGRES_PASSWORD URI-unsafe characters — pre-existing and unchanged by the PR; only /, #, % break new URL(), not the @/: that were flagged, and Compose builds the DSN in YAML so the route can't encode it. output-select losing chip chrome — that is the change; the editor sub-block tree has 0 ChipCombobox against 33 Combobox. Metadata revision emitted without a content timestamp — content_updated_at is NOT NULL, and the comparison uses the same coalesce as the issuer. Version-head retry — head.version + 1 is the documented implicit current version, and the read is a single-statement correlated subquery. Unbounded cleanup dispatch — the per-call cap is the documented family-wide contract, and the task runs on a queue with concurrencyLimit: 1. toStringOrNull wire-shape change — byte-identical to the asString it replaced. CodeQL insufficient password hash — a cache key compared for equality, not a password verifier; high-entropy API keys, so a slow KDF buys nothing. Type of Change Bug fix Testing 1,062 vitest tests green across the affected areas, including 9 new ones. Verified each new test fails against the unfixed code before keeping it. bun run check:audits 47/47, bun run lint:check 26/26, type-check clean on apps/sim and packages/sim-cli. OpenAPI, CLI API, MCP operations, and CLI docs regenerated; the response gains an optional field only. 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) 🤖 Generated with Claude Code

Open Graph Description: Summary Follow-ups to the review findings on #8096. Ten findings were raised there; I investigated each one. Three were real and are fixed here, seven were not and were dismissed on the threads. Fi...

X Description: Summary Follow-ups to the review findings on #8096. Ten findings were raised there; I investigated each one. Three were real and are fixed here, seven were not and were dismissed on the threads. Fi...

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

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:b857aed5-10b8-3a88-c28c-fbcdbfcf4b7e
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id8570:27DCD7:EBCB76:141E117:6AFB5D5C
html-safe-nonce6ddf8eef64d898e7a6899d4f1391c5f2839bd63a4c43264193dd917fe304437a
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NTcwOjI3RENENzpFQkNCNzY6MTQxRTExNzo2QUZCNUQ1QyIsInZpc2l0b3JfaWQiOiI3OTkzMTQyMzY4MjU1MzAzMDA0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac4cf61b3f3bc973820c6f324c524ebe4ced43419789c5ba771d09cd977b6b53de
hovercard-subject-tagpull_request:4587864768
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/8098/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 Follow-ups to the review findings on #8096. Ten findings were raised there; I investigated each one. Three were real and are fixed here, seven were not and were dismissed on the threads. Fi...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noneea33d13c96d0ff66bd8fa906b193d2213536b78cb06b0c50a4632c58b1418f94
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
release59ef97164c52cf59bd10558ddec9c4f482763988
ui-targetcanary-2
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/8098/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F8098%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%2F8098%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/8098/files
Reloadhttps://github.com/simstudioai/sim/pull/8098/files
Reloadhttps://github.com/simstudioai/sim/pull/8098/files
simstudioaihttps://github.com/simstudioai
simhttps://github.com/simstudioai/sim
Codehttps://github.com/simstudioai/sim
Issues129 (129)https://github.com/simstudioai/sim/issues
Pull requests197 (197)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
fix/pr8096-review-followupshttps://github.com/simstudioai/sim/tree/fix/pr8096-review-followups
Conversation 12 https://github.com/simstudioai/sim/pull/8098
Commits 2 https://github.com/simstudioai/sim/pull/8098/commits
Checks 33 https://github.com/simstudioai/sim/pull/8098/checks
Files changed https://github.com/simstudioai/sim/pull/8098/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/8098/files
fix(files,realtime): issue a revision on revert and stop resurrecting cleared cursors https://github.com/simstudioai/sim/pull/8098/files#top
Show all changes 2 commits https://github.com/simstudioai/sim/pull/8098/files
a6cec88 fix(files,realtime): issue a revision on revert and stop resurrecting… waleedlatif1 Sep 21, 2026 https://github.com/simstudioai/sim/pull/8098/commits/a6cec8803fc1f20207df7bb72c56a15b7d990e6c
d2e1475 fix(docs): match the revert example revision to its own record timestamp waleedlatif1 Sep 21, 2026 https://github.com/simstudioai/sim/pull/8098/commits/d2e1475f4d11386d6383dd6e283aeb8d07d0b0a7
Clear filters https://github.com/simstudioai/sim/pull/8098/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/8098/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/8098/files
openapi-v2-files-audit.json https://github.com/simstudioai/sim/pull/8098/files#diff-c6918d7f933ec43ee8b8a4983d19f272b35962e2510bad721fc05d6d82b41b8d
route.ts https://github.com/simstudioai/sim/pull/8098/files#diff-07d82c533abd14bfe90fd1f6977f3a060fec0eaa6f271e9a34e40729f3884470
route.ts https://github.com/simstudioai/sim/pull/8098/files#diff-96837357eac2ed1ede28d2c7d39af4486397c26575f4a95da7d5cc5d6b0a00ef
route.test.ts https://github.com/simstudioai/sim/pull/8098/files#diff-1fbf4d3ba6428014daae370fb2586025d197d97e19ae5366ae7a9159d302adea
route.ts https://github.com/simstudioai/sim/pull/8098/files#diff-9a4d64ce771b573f5d2b8166664c4176b163bbbfa606e96c08c1829aa9622482
socket-presence-merge.test.ts https://github.com/simstudioai/sim/pull/8098/files#diff-7a80f0ac63568884d4edbb55e23d3dd5ee7d4d731465989e98aef7bc10eaefa5
socket-presence-merge.ts https://github.com/simstudioai/sim/pull/8098/files#diff-a13a5133fafada3150803b7a4bdcea21c5eedf0f1ada4203285beb15376593d5
socket-provider.tsx https://github.com/simstudioai/sim/pull/8098/files#diff-645e13e3a4827b0a88e66b25a614a116dd7838dddb42745a86247d3a8ca8ab61
file.ts https://github.com/simstudioai/sim/pull/8098/files#diff-9b42548aa30ce9a74dfede994f6a2bbcf873c4a1c323f30ca693b4b2494ea79d
file-versions.ts https://github.com/simstudioai/sim/pull/8098/files#diff-c01f86cd43d759a24c28fd1ecf8c29166dc2a0b2ff34a300b510c92bbc6ea218
files.ts https://github.com/simstudioai/sim/pull/8098/files#diff-615f44153f90418dc013f064e82e3f80f38bee63452ab7612e669651365c90b9
files-audit.ts https://github.com/simstudioai/sim/pull/8098/files#diff-97319965ae7aacfb970845624bee9f5e4374c04df6c9b9487ccc26900660ec63
operations.ts https://github.com/simstudioai/sim/pull/8098/files#diff-8e5b9606c97b1fe1307e2813b58c25851c7ada477f5a6b8805c5f456b11b5138
file-revision.ts https://github.com/simstudioai/sim/pull/8098/files#diff-1ccbb607b2d955fd7a037dfcde799749c955ee50a994953c2dac816b4d3b5e4a
file-versions.test.ts https://github.com/simstudioai/sim/pull/8098/files#diff-d68c013d75d3d729efd979214cbcb2d8c3ed406d7a3cb7abaf0d370814ab7ff8
v2-api.ts https://github.com/simstudioai/sim/pull/8098/files#diff-e856e756b18965607efb943e85bad153871936ce3ee5180ec2e8073a28dd1dd7
apps/docs/openapi-v2-files-audit.jsonhttps://github.com/simstudioai/sim/pull/8098/files#diff-c6918d7f933ec43ee8b8a4983d19f272b35962e2510bad721fc05d6d82b41b8d
View file https://github.com/simstudioai/sim/blob/d2e1475f4d11386d6383dd6e283aeb8d07d0b0a7/apps/docs/openapi-v2-files-audit.json
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/8098/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/8098/files#diff-c6918d7f933ec43ee8b8a4983d19f272b35962e2510bad721fc05d6d82b41b8d
https://github.com/simstudioai/sim/pull/8098/files#diff-c6918d7f933ec43ee8b8a4983d19f272b35962e2510bad721fc05d6d82b41b8d
https://github.com/simstudioai/sim/pull/8098/files#diff-c6918d7f933ec43ee8b8a4983d19f272b35962e2510bad721fc05d6d82b41b8d
https://github.com/simstudioai/sim/pull/8098/files#diff-c6918d7f933ec43ee8b8a4983d19f272b35962e2510bad721fc05d6d82b41b8d
apps/sim/app/api/v2/files/[fileId]/content/route.tshttps://github.com/simstudioai/sim/pull/8098/files#diff-07d82c533abd14bfe90fd1f6977f3a060fec0eaa6f271e9a34e40729f3884470
View file https://github.com/simstudioai/sim/blob/d2e1475f4d11386d6383dd6e283aeb8d07d0b0a7/apps/sim/app/api/v2/files/%5BfileId%5D/content/route.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/8098/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/8098/files#diff-07d82c533abd14bfe90fd1f6977f3a060fec0eaa6f271e9a34e40729f3884470
https://github.com/simstudioai/sim/pull/8098/files#diff-07d82c533abd14bfe90fd1f6977f3a060fec0eaa6f271e9a34e40729f3884470
https://github.com/simstudioai/sim/pull/8098/files#diff-07d82c533abd14bfe90fd1f6977f3a060fec0eaa6f271e9a34e40729f3884470
https://github.com/simstudioai/sim/pull/8098/files#diff-07d82c533abd14bfe90fd1f6977f3a060fec0eaa6f271e9a34e40729f3884470
https://github.com/simstudioai/sim/pull/8098/files#diff-07d82c533abd14bfe90fd1f6977f3a060fec0eaa6f271e9a34e40729f3884470
apps/sim/app/api/v2/files/[fileId]/metadata/route.tshttps://github.com/simstudioai/sim/pull/8098/files#diff-96837357eac2ed1ede28d2c7d39af4486397c26575f4a95da7d5cc5d6b0a00ef
View file https://github.com/simstudioai/sim/blob/d2e1475f4d11386d6383dd6e283aeb8d07d0b0a7/apps/sim/app/api/v2/files/%5BfileId%5D/metadata/route.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/8098/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/8098/files#diff-96837357eac2ed1ede28d2c7d39af4486397c26575f4a95da7d5cc5d6b0a00ef
https://github.com/simstudioai/sim/pull/8098/files#diff-96837357eac2ed1ede28d2c7d39af4486397c26575f4a95da7d5cc5d6b0a00ef
apps/sim/app/api/v2/files/[fileId]/versions/[version]/revert/route.test.tshttps://github.com/simstudioai/sim/pull/8098/files#diff-1fbf4d3ba6428014daae370fb2586025d197d97e19ae5366ae7a9159d302adea
View file https://github.com/simstudioai/sim/blob/d2e1475f4d11386d6383dd6e283aeb8d07d0b0a7/apps/sim/app/api/v2/files/%5BfileId%5D/versions/%5Bversion%5D/revert/route.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/8098/{{ revealButtonHref }}
Please reload this pagehttps://github.com/simstudioai/sim/pull/8098/files
apps/sim/app/api/v2/files/[fileId]/versions/[version]/revert/route.tshttps://github.com/simstudioai/sim/pull/8098/files#diff-9a4d64ce771b573f5d2b8166664c4176b163bbbfa606e96c08c1829aa9622482
View file https://github.com/simstudioai/sim/blob/d2e1475f4d11386d6383dd6e283aeb8d07d0b0a7/apps/sim/app/api/v2/files/%5BfileId%5D/versions/%5Bversion%5D/revert/route.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/8098/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/8098/files#diff-9a4d64ce771b573f5d2b8166664c4176b163bbbfa606e96c08c1829aa9622482
https://github.com/simstudioai/sim/pull/8098/files#diff-9a4d64ce771b573f5d2b8166664c4176b163bbbfa606e96c08c1829aa9622482
apps/sim/app/workspace/providers/socket-presence-merge.test.tshttps://github.com/simstudioai/sim/pull/8098/files#diff-7a80f0ac63568884d4edbb55e23d3dd5ee7d4d731465989e98aef7bc10eaefa5
View file https://github.com/simstudioai/sim/blob/d2e1475f4d11386d6383dd6e283aeb8d07d0b0a7/apps/sim/app/workspace/providers/socket-presence-merge.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/8098/{{ revealButtonHref }}
apps/sim/app/workspace/providers/socket-presence-merge.tshttps://github.com/simstudioai/sim/pull/8098/files#diff-a13a5133fafada3150803b7a4bdcea21c5eedf0f1ada4203285beb15376593d5
View file https://github.com/simstudioai/sim/blob/d2e1475f4d11386d6383dd6e283aeb8d07d0b0a7/apps/sim/app/workspace/providers/socket-presence-merge.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/8098/{{ revealButtonHref }}
Please reload this pagehttps://github.com/simstudioai/sim/pull/8098/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/8098/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.