Title: fix(mothership): decide once whether a queued send may already be on the server by waleedlatif1 · Pull Request #8727 · simstudioai/sim · GitHub
Open Graph Title: fix(mothership): decide once whether a queued send may already be on the server by waleedlatif1 · Pull Request #8727 · simstudioai/sim
X Title: fix(mothership): decide once whether a queued send may already be on the server by waleedlatif1 · Pull Request #8727 · simstudioai/sim
Description: Summary Follow-up to #8723. This closes the remaining ways a queued message the server may already hold could be edited into a second turn, and decides that question in one place instead of several. One source of truth for "this id may already be on the server". Before this PR the answer was inferred separately by the store guard, a stopRequired exemption, the stored-handoff restore, and the notAdmitted/neverSent results. The exemption was wrong: a Send-now reuses a re-queued message's earlier id, which may already have reached the server. startSendMessage now decides it where it chooses the id. A reused id carries its queue entry's admissionUnknown, and is unknown when the entry doesn't say. A fresh id is unsent until its POST goes out. Only the server refusing the id clears it. That one value rides the withdrawal result, the stored queued-send handoff, and the queue entry. The notAdmitted/neverSent pair and the stopRequired exemption are gone. The store guard reads only the flag. It fills the flag in only for writers with no say (a session saved before it existed, a send handed over from another surface). A Send-now restored from its stored handoff can't be edited. After a reload the handoff comes back with the flag it was stored with, including a resumed message whose Stop hadn't settled yet. A send superseded at admission is answered as a duplicate. Admission's "superseded" conflict means another attempt with the same id re-took the claim after the 60s in-progress TTL ran out, which can happen because branch, attachment and context preparation all run before admission. That attempt may admit the turn. It used to come back as a bare 409, read as a busy refusal. Admission now throws ChatSendSupersededError, and the route answers it as a 409 naming the send's own id, so the client keeps the message under that id. Doc fixes: claimChatSend fails closed with a 500 (its storage is forced to Postgres), not open. The admission flag's comment notes the 1-hour claim TTL. Type of Change Bug fix Testing DOM: keeps a resumed Send-now uneditable when the page reloads before its Stop settles: the reviewer's probe, end to end. It fails on this PR's previous head. guards a Send-now restored from its stored handoff, for both values of the stored flag. Fails on staging. keeps a send answered as a duplicate with no stream uneditable, then retries it. Store: reads a reused handoff id as possibly sent unless the entry says otherwise. Fails on staging. Route: answers a send superseded at admission as a duplicate naming its id. Fails against the staging route. Admission: refuses to admit a send whose claim another attempt took. Fails on staging. The full gate and integration tests ran on the CI runner. 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 Follow-up to #8723. This closes the remaining ways a queued message the server may already hold could be edited into a second turn, and decides that question in one place instead of several...
X Description: Summary Follow-up to #8723. This closes the remaining ways a queued message the server may already hold could be edited into a second turn, and decides that question in one place instead of several...
Opengraph URL: https://github.com/simstudioai/sim/pull/8727
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,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-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:24777f47-1468-76c5-4e23-92a384f88059 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | E76A:1F76:AA541:EB33F:6AFB5729 |
| html-safe-nonce | bd744078b877eb300e3ab61e8858aec511a6e49a78a5087d7a7a1ab3bc3918fe |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNzZBOjFGNzY6QUE1NDE6RUIzM0Y6NkFGQjU3MjkiLCJ2aXNpdG9yX2lkIjoiNTE1OTMyMzk0Mjc4NjkxNDA4OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 797d775150082b7e7e6ddd87d61047a1e94f7507146680ba899bc436b65cf7ac |
| hovercard-subject-tag | pull_request:4768458710 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/8727/files |
| twitter:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| og:image:alt | Summary Follow-up to #8723. This closes the remaining ways a queued message the server may already hold could be edited into a second turn, and decides that question in one place instead of several... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7122bb414b542dba14d71a3f0b9f6fd2abce715b9f5912d082800563e6c806d1 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/simstudioai/sim git https://github.com/simstudioai/sim.git |
| octolytics-dimension-user_id | 199344406 |
| octolytics-dimension-user_login | simstudioai |
| octolytics-dimension-repository_id | 912559512 |
| octolytics-dimension-repository_nwo | simstudioai/sim |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 912559512 |
| octolytics-dimension-repository_network_root_nwo | simstudioai/sim |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | cbf66c024bb6d10e6955baa7413c54cf13a201bb |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width