Repository navigation
perf(conversations): Read status with fewer event scans - #4120
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Give me a thorough review of this change. I wanna make sure we're not adding stuff that's gonna be a problem later |
|
Review of 1. Must-fix: the branch is stale against main. It conflicts in 2. Should-fix: the tests don't catch two of the rewritten rules. I mutation-tested them:
3. Optional: index and comments.
Checked, no issue: seq ties ( |
1feb81c to
5e9ec82
Compare
The sign-in wait reads only the newest authorization request, then checks that no event that ends a wait follows it. The failed-Turn check reads the newest turn_failed, then checks for a later Turn start or end, so most Conversations stop at the first read. Location aggregates read a root's failed Turn once per root, not once per tree row. The latest assistant reply reads a new partial index in seq order, so it no longer sorts every assistant Message of the Conversation.
5e9ec82 to
4ccd581
Compare
This prepares `main` for a merge queue. Two PRs that each add a migration off the same parent both pass CI on their own, then leave two migration leaves on `main`. That happened with #4377 and #4120, and before them with #4224, #4290, #4313 and #4279. A merge queue tests each PR merged on top of the ones ahead of it, but only if `ci / required` reports on `merge_group` runs. That's what this adds. On `merge_group`, `getsentry/action-filter-paths` matches every filter, as on a push, so every path-gated job that `ci / required` needs runs. Two jobs still skip, as they do on a push to `main`, and a skipped job passes `ci / required`: - `pack-release-artifacts` runs only on push. - `ios` runs only on pull requests, because `ios.yml` runs on its own for pushes to `main`. Frameshift doesn't save or report screenshots on queue runs. Turning on the merge queue itself is a separate change to the `main` ruleset. "Require branches to be up to date" stays off. <!-- junior-request-attribution:start --> via @BYK. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent%3A9ec51d25699838a155f2ddc2f0ffb45f --> -- [View Session](https://junior-prod.sentry.dev/conversations/agent%3A9ec51d25699838a155f2ddc2f0ffb45f) [[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3A9ec51d25699838a155f2ddc2f0ffb45f/?project=4510944073809921) <!-- junior-session-footer:end --> Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: BYK <[email protected]>
Status is still derived exactly and in one place (
conversationStatusSql). This change makes the reads it depends on cheaper. Follows #2951 (part of #2888).authorizationWait): reads the newestauthorization_requested, then checks withNOT EXISTSfor a later event of the four end types. The old form walked back over every later event.conversationTurnFailedSql): uses a short-circuit form. It takes the newestturn_failedand checks for no later start or complete. Status, the feed and the aggregates all share this one derivation.failedonce per root instead of once per joined tree row. People checkstopped_atbefore reading events.junior_conversation_events_message_role_seq_idx(CONCURRENTLY IF NOT EXISTS), a partial index ontype = 'message'ordered byseq, so the status read no longer sorts every assistant message.message_role_idxstays, because the activity preview and outline read increated_atorder.No status cache.
via @dcramer.
--
View Session [Sentry]