{{ message }}
Repository navigation
fix: return 404 when a presence disappears during update - #13792
Merged
Merged
Conversation
updateDocument returns an empty document when the row was deleted or expired between the action's read and its write. Serializing that as a presence threw on $permissions and surfaced as a 500 (Sentry CLOUD-3QWW). Treat the empty result as presence not found.
Contributor
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
…e empty-result guard
Member
Author
|
@greptile review |
Member
Author
The console suite has no API key, so the test now uses each side's own headers, and the concurrent calls go through the shared e2e client inside coroutines instead of raw curl.
Other suites can race requests the same way without reimplementing the coroutine plumbing.
Enabling the coroutine curl hook leaves it on for the rest of the process, so every later test in the same suite failed on CI with 'Failed initialization'. The client now builds and parses handles through shared methods and runs the concurrent set through curl_multi.
loks0n
approved these changes
Sep 21, 2026
TorstenDittmann
approved these changes
Sep 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What does this PR do?
PATCH /v1/presences/:presenceIdreads the presence, then writes. If the presence is deleted or expires in between,updateDocumentreturns an empty document, and serializing it as a presence throws$permissions must be an array of type string, a 500. Fixes Sentry CLOUD-3QWW, 509 events since 9/5. The empty result is now mapped to404 presence_not_found, and a requested list-cache purge still runs on that path.Test Plan
New E2E
testUpdateWhilePresenceIsDeletedinPresenceBasecreates a presence and fires its update and delete concurrently, twenty times per side. It forbids any 500, checks thepresence_not_foundshape whenever the update loses the race, and checks the presence is gone from the list afterwards. Without the guard the race reproduces the exact production 500 within the twenty attempts; with it both sides are green.Checklist