Fix sentry-triage bug bash issues and stream org project pagination - #2948
Fix sentry-triage bug bash issues and stream org project pagination#2948liztom wants to merge 1 commit into
Conversation
🔒 PR Risk Scan ResultsScanned 10 changed file(s).
|
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Stale enrichment and project-list state can overwrite newer state, while pagination and model refresh contain truncation or selection inconsistencies.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Balanced
Findings: 4
New issues introduced by this change (4)
| Severity | Finding |
|---|---|
extensions/sentry-triage/extension.mjs — Replacing the catalog can invalidate per-card selections that were made from the fallback list, but… |
|
extensions/sentry-triage/extension.mjs — A stale enrichment clears the shared flag before checking its generation. If scan A finishes after… |
|
extensions/sentry-triage/extension.mjs — The streamed callback replaces the server's existing list before known is read below. On a retry… |
|
extensions/sentry-triage/sentry.mjs — This marks a traversal complete on a short page even when the SDK explicitly reports `hasMore:… |
What changed in this PR
Improves Sentry Triage reliability, responsiveness, model discovery, and work-status clarity.
Changes:
- Loads models dynamically with fallbacks and gates plain-English summaries during enrichment.
- Streams serialized project pagination and improves project lookup handling.
- Clarifies work statuses and bumps the plugin to v1.2.0.
| File | Description |
|---|---|
plugins/sentry-triage/plugin.json |
Bumps plugin version. |
extensions/sentry-triage/state.mjs |
Adds model-catalog and enrichment state. |
extensions/sentry-triage/server.mjs |
Broadcasts enrichment status. |
extensions/sentry-triage/sentryClient.mjs |
Adds queued cursor-based project pages. |
extensions/sentry-triage/sentry.mjs |
Streams bounded project pagination. |
extensions/sentry-triage/package.json |
Bumps extension version. |
extensions/sentry-triage/extension.mjs |
Coordinates models, enrichment, projects, and work states. |
extensions/sentry-triage/components/page.mjs |
Updates controls, project resolution, and UI copy. |
extensions/sentry-triage/components/card.mjs |
Adds operation-specific status labels. |
.github/plugin/marketplace.json |
Regenerates marketplace version metadata. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
d6a381d to
bf882f1
Compare
bf882f1 to
f22c024
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Concurrent enrichment and retry pagination can expose stale toggle state and cache truncated project lists.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Balanced
Findings: 2
New issues introduced by this change (3)
| Severity | Finding |
|---|---|
extensions/sentry-triage/extension.mjs — A stale scan can clear the flag for a newer scan here: scan A may finish enrichment after scan B… |
|
extensions/sentry-triage/sentry.mjs — Do not infer completion from page length when the SDK explicitly reports hasMore. Sentry's… |
|
extensions/sentry-triage/components/page.mjs — The rename is incomplete: the exact post-enrichment message in extension.mjs:955 still tells… |
Issues resolved since last review (4)
| Severity | Finding |
|---|---|
extensions/sentry-triage/sentry.mjs — This marks a traversal complete on a short page even when the SDK explicitly reports `hasMore:… View resolved comment |
|
extensions/sentry-triage/extension.mjs — The streamed callback replaces the server's existing list before known is read below. On a retry… View resolved comment |
|
extensions/sentry-triage/extension.mjs — A stale enrichment clears the shared flag before checking its generation. If scan A finishes after… View resolved comment |
|
extensions/sentry-triage/extension.mjs — Replacing the catalog can invalidate per-card selections that were made from the fallback list, but… View resolved comment |
Suppressed comments (1)
extensions/sentry-triage/extension.mjs:1180
- Each retry starts
partialfrom an empty list, so this callback immediately overwrites any longer server-side list from a previous traversal. By the time the finalknowncomparison runs, that prior list has already been lost; a newly connected client can therefore receive the truncated retry despite the preservation logic below. Preserve the longer same-org snapshot while streaming too.
if (!conn || !conn.sentry || !conn.sentry.reachable) return
if (!force && entry._projectsFetchedFor === slug) return
try {
// Seed the keep-longest guard from any list a PRIOR run already published for
f22c024 to
7a14ffe
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Enrichment can remain permanently disabled after an aborted replacement scan, and completed shorter project lists are incorrectly rejected.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Balanced
Findings: 2
New issues introduced by this change (2)
| Severity | Finding |
|---|---|
extensions/sentry-triage/components/page.mjs — This unconditional length guard rejects an authoritative refresh whenever an organization has… |
|
extensions/sentry-triage/extension.mjs — The generation guard avoids scan A clearing scan B's flag, but it can also leave the toggle… |
Issues resolved since last review (3)
| Severity | Finding |
|---|---|
extensions/sentry-triage/components/page.mjs — The rename is incomplete: the exact post-enrichment message in extension.mjs:955 still tells… View resolved comment |
|
extensions/sentry-triage/sentry.mjs — Do not infer completion from page length when the SDK explicitly reports hasMore. Sentry's… View resolved comment |
|
extensions/sentry-triage/extension.mjs — A stale scan can clear the flag for a newer scan here: scan A may finish enrichment after scan B… View resolved comment |
Suppressed comments (1)
extensions/sentry-triage/extension.mjs:1211
- Selecting the result solely by length keeps projects that were legitimately removed. For example, after a previously complete 200-project snapshot, a successful refresh returning 150 projects retains the old 200 entries and then marks that stale list as fetched. A complete traversal should replace the snapshot even when shorter; keep the longer prior snapshot only when
completeis false. The browser-side length guard must be adjusted with this change too.
const known = entry.state.getProjectsOrg() === slug ? entry.state.getProjects() : []
const best = Array.isArray(known) && known.length > projects.length ? known : projects
// Only treat the list as definitively cached when the traversal actually
// ran to completion. A truncated run must stay retryable, otherwise the
// first unlucky attempt pins a partial list for the life of the panel.
if (complete) entry._projectsFetchedFor = slug
entry.state.setProjects(best, slug)
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The pagination, stale-scan, model-refresh, and UI synchronization paths are internally consistent, and prior findings are resolved.
Review tier: Balanced
Findings: 2
Pre-existing issues (2)
| Severity | Finding |
|---|---|
extensions/sentry-triage/extension.mjs — The generation guard avoids scan A clearing scan B's flag, but it can also leave the toggle… View comment |
|
extensions/sentry-triage/components/page.mjs — This unconditional length guard rejects an authoritative refresh whenever an organization has… View comment |
Bug-bash fixes for the sentry-triage canvas extension: - Model list: auto-refresh via session.rpc.model.list() with a static fallback, instead of a hardcoded list that went stale. - Plain-English toggle: gate the toggle until enrichPlainEnglish() completes, fixing a race where it was interactive before enrichment finished. Add a preparing hint while it runs. - Copy: 'Plain-English titles' -> 'Plain-English messages'; simplify the loading hint. - Work status labels: distinguish 'starting Copilot fix session' vs 'filing tracking issue' instead of a generic 'working', and mark the Fix-with-Copilot toast as non-blocking. - Org project pagination: page the traversal as discrete queued tasks bounded by page count, driven by the SDK envelope hasMore flag, so a mega-org no longer starves interactive lookups and an incomplete traversal is never cached as complete. No Promise.race timeout is used because sentry@0.42.2 exposes no per-call cancellation and an abandoned call would corrupt module-global cursor state. Bump plugin to 1.2.0 and regenerate marketplace.json. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
7a14ffe to
bd537a7
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Pagination can still stop despite an advancing cursor, and two live UI paths do not fully enforce the intended labels and enrichment gate.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Balanced
Findings: 3
New issues introduced by this change (3)
| Severity | Finding |
|---|---|
extensions/sentry-triage/components/card.mjs — This label change only affects the server-rendered Card. Live queued/working updates are rendered… |
|
extensions/sentry-triage/extension.mjs — The first categories snapshot is broadcast before the enriching flag is set, so it explicitly tells… |
|
extensions/sentry-triage/sentry.mjs — A page that contributes no new valid slugs can still have hasMore: true and an advancing opaque… |
Issues resolved since last review (2)
| Severity | Finding |
|---|---|
extensions/sentry-triage/extension.mjs — The generation guard avoids scan A clearing scan B's flag, but it can also leave the toggle… View resolved comment |
|
extensions/sentry-triage/components/page.mjs — This unconditional length guard rejects an authoritative refresh whenever an organization has… View resolved comment |
| if (workStatus.phase === 'working' || workStatus.phase === 'queued') { | ||
| return workStatus.copilotFix ? '⏳ starting Copilot fix session…' : '⏳ filing tracking issue…' |
| entry.state.setCategories(categories) | ||
| entry.notifyClients() | ||
| entry.state.setPlainEnglishEnriching(true) | ||
| if (entry.notifyPlainEnglishEnriching) entry.notifyPlainEnglishEnriching(true) |
| if (!result.nextCursor || added === 0) break | ||
| cursor = result.nextCursor |


Summary
Fixes found during a bug bash on the
sentry-triagecanvas extension:session.rpc.model.list()with a static fallback if the RPC is unavailable.enrichPlainEnglish()finished, causing inconsistent behavior between users. Now gated/disabled with a "Preparing plain-English summaries…" hint until enrichment completes.hasMoreflag, so an incomplete traversal is never cached as complete.Bumps the plugin to 1.2.0 and regenerates
marketplace.json.Known limitation (project pagination)
A single genuinely-stalled
project.listpage can still block interactive lookups until it returns, becausesentry@0.42.2exposes no per-call cancellation — itsAbortSignalis client-wide and documented for streaming commands only (log list --follow), and is not honored for one-shot requests. APromise.racetimeout is deliberately not used because it would let the abandoned SDK call keep running and overlap the next queued call, corrupting the SDK's module-global cursor state (the exact serialization guarantee this change preserves).Testing
Verified locally via a side-by-side local test copy of the extension, confirming reload/open succeeds and each fix behaves as expected in the live canvas UI.