Skip to content

Fix sentry-triage bug bash issues and stream org project pagination - #2948

Open
liztom wants to merge 1 commit into
github:mainfrom
liztom:sentry-triage-bug-bash-fixes
Open

Fix sentry-triage bug bash issues and stream org project pagination#2948
liztom wants to merge 1 commit into
github:mainfrom
liztom:sentry-triage-bug-bash-fixes

Conversation

@liztom

@liztom liztom commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes found during a bug bash on the sentry-triage canvas extension:

  • Model list: was hardcoded and going stale. Now auto-refreshes via session.rpc.model.list() with a static fallback if the RPC is unavailable.
  • Plain-English toggle race condition: the toggle was interactive before enrichPlainEnglish() finished, causing inconsistent behavior between users. Now gated/disabled with a "Preparing plain-English summaries…" hint until enrichment completes.
  • Copy clarity: "Plain-English titles" → "Plain-English messages"; simplified the loading hint copy.
  • Work status labels: cards distinguish "⏳ starting Copilot fix session…" vs "⏳ filing tracking issue…" instead of a generic "⏳ working…", and the Fix-with-Copilot toast notes it's non-blocking.
  • Org project pagination: mega-orgs previously held the shared SDK queue for the entire multi-page traversal, starving interactive Sentry lookups. Each page is now its own queued task with an explicit cursor, bounded by page count instead of wall-clock. Completion is driven by the SDK envelope's hasMore flag, 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.list page can still block interactive lookups until it returns, because sentry@0.42.2 exposes no per-call cancellation — its AbortSignal is client-wide and documented for streaming commands only (log list --follow), and is not honored for one-shot requests. A Promise.race timeout 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.

@liztom
liztom requested a review from aaronpowell as a code owner September 5, 2026 00:35
Copilot AI balanced review requested due to automatic review settings September 5, 2026 00:35
@github-actions github-actions Bot added canvas-extension PR touches canvas extensions plugin PR touches plugins labels Sep 5, 2026
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

🔒 PR Risk Scan Results

Scanned 10 changed file(s).

Severity Count
🔴 High 0
🟠 Medium 1
ℹ️ Info 0
Severity Rule File Line Match
🟠 package-exec-command extensions/sentry-triage/sentryClient.mjs 192 // flow — the exact same flow `npx sentry auth login` drives from a

This is an automated soft-gate report. Findings indicate review targets and do not block merge by themselves.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Medium severity

New issues introduced by this change (4)
Severity Finding
Medium severity extensions/​sentry-triage/​extension.mjs — Replacing the catalog can invalidate per-card selections that were made from the fallback list, but…
Medium severity extensions/​sentry-triage/​extension.mjs — A stale enrichment clears the shared flag before checking its generation. If scan A finishes after…
Medium severity extensions/​sentry-triage/​extension.mjs — The streamed callback replaces the server's existing list before known is read below. On a retry…
Medium severity 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.

Comment thread extensions/sentry-triage/extension.mjs
Comment thread extensions/sentry-triage/extension.mjs
Comment thread extensions/sentry-triage/extension.mjs
Comment thread extensions/sentry-triage/sentry.mjs Outdated
Copilot AI review requested due to automatic review settings September 5, 2026 00:41
@liztom
liztom force-pushed the sentry-triage-bug-bash-fixes branch from d6a381d to bf882f1 Compare September 5, 2026 00:41
@liztom
liztom force-pushed the sentry-triage-bug-bash-fixes branch from bf882f1 to f22c024 Compare September 5, 2026 00:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Medium severity · 1 Low severity

New issues introduced by this change (3)
Severity Finding
Medium severity 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…
Medium severity extensions/​sentry-triage/​sentry.mjs — Do not infer completion from page length when the SDK explicitly reports hasMore. Sentry's…
Low severity 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
Medium severity extensions/​sentry-triage/​sentry.mjs — This marks a traversal complete on a short page even when the SDK explicitly reports `hasMore:… View resolved comment
Medium severity 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
Medium severity extensions/​sentry-triage/​extension.mjs — A stale enrichment clears the shared flag before checking its generation. If scan A finishes after… View resolved comment
Medium severity 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 partial from an empty list, so this callback immediately overwrites any longer server-side list from a previous traversal. By the time the final known comparison 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

Comment thread extensions/sentry-triage/extension.mjs Outdated
Comment thread extensions/sentry-triage/sentry.mjs Outdated
Comment thread extensions/sentry-triage/components/page.mjs
Copilot AI review requested due to automatic review settings September 5, 2026 00:48
@liztom
liztom force-pushed the sentry-triage-bug-bash-fixes branch from f22c024 to 7a14ffe Compare September 5, 2026 00:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Medium severity

New issues introduced by this change (2)
Severity Finding
Medium severity extensions/​sentry-triage/​components/​page.mjs — This unconditional length guard rejects an authoritative refresh whenever an organization has…
Medium severity 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
Low severity extensions/​sentry-triage/​components/​page.mjs — The rename is incomplete: the exact post-enrichment message in extension.mjs:955 still tells… View resolved comment
Medium severity extensions/​sentry-triage/​sentry.mjs — Do not infer completion from page length when the SDK explicitly reports hasMore. Sentry's… View resolved comment
Medium severity 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 complete is 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)

Comment thread extensions/sentry-triage/components/page.mjs
Comment thread extensions/sentry-triage/extension.mjs
Copilot AI review requested due to automatic review settings September 5, 2026 00:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Medium severity

Pre-existing issues (2)
Severity Finding
Medium severity 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
Medium severity 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>
Copilot AI review requested due to automatic review settings September 5, 2026 03:52
@liztom
liztom force-pushed the sentry-triage-bug-bash-fixes branch from 7a14ffe to bd537a7 Compare September 5, 2026 03:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Medium severity

New issues introduced by this change (3)
Severity Finding
Medium severity extensions/​sentry-triage/​components/​card.mjs — This label change only affects the server-rendered Card. Live queued/working updates are rendered…
Medium severity extensions/​sentry-triage/​extension.mjs — The first categories snapshot is broadcast before the enriching flag is set, so it explicitly tells…
Medium severity 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
Medium severity 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
Medium severity extensions/​sentry-triage/​components/​page.mjs — This unconditional length guard rejects an authoritative refresh whenever an organization has… View resolved comment

Comment on lines +5 to +6
if (workStatus.phase === 'working' || workStatus.phase === 'queued') {
return workStatus.copilotFix ? '⏳ starting Copilot fix session…' : '⏳ filing tracking issue…'
Comment on lines 834 to +837
entry.state.setCategories(categories)
entry.notifyClients()
entry.state.setPlainEnglishEnriching(true)
if (entry.notifyPlainEnglishEnriching) entry.notifyPlainEnglishEnriching(true)
Comment on lines +282 to +283
if (!result.nextCursor || added === 0) break
cursor = result.nextCursor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

canvas-extension PR touches canvas extensions plugin PR touches plugins

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants