Skip to content

Prevent infinite recursion reporting a problem - #8031

Merged
andrew-polk merged 1 commit into
masterfrom
PreventInfiniteRecursionReportingError
Jul 30, 2026
Merged

Prevent infinite recursion reporting a problem#8031
andrew-polk merged 1 commit into
masterfrom
PreventInfiniteRecursionReportingError

Conversation

@StephenMcConnel

@StephenMcConnel StephenMcConnel commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Devin review


This change is Reviewable

@greptile-apps

greptile-apps Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds a per-thread boolean flag (s_isReporting) to break a mutual-recursion cycle where ShowToast triggers a network/reporting operation that eventually calls back into NonFatalProblem.Report, causing a StackOverflowException.

  • The [ThreadStatic] attribute is the right tool here: the recursion is synchronous and same-thread, so per-thread isolation correctly blocks the cycle without affecting unrelated threads.
  • The finally block in the new code guarantees the flag is reset even if ShowToast throws, and the guard is placed precisely at the passive/toast code path that produces the cycle.

Important Files Changed

Filename Overview
src/BloomExe/NonFatalProblem.cs Adds a [ThreadStatic] reentrancy guard around ShowToast to break the Report → ShowToast → SendBundle → ReportConnectionError → Report recursion cycle; implementation is correct.

Reviews (1): Last reviewed commit: "Prevent infinite recursion reporting a p..." | Re-trigger Greptile

@StephenMcConnel

Copy link
Copy Markdown
Contributor Author

🤖 Claude Opus 4.8 (1M context)

Consulted Devin on 2026-07-30 20:46 UTC up to commit 2e72e28.

Re-review clean — 0 Bugs, 0 Investigate flags. Devin raised 2 Informational items (not action-required, not mirrored as threads):

  1. The reentrancy guard covers the toast path but not the modal-dialog path. Devin confirms this is safe for the known recursion trigger (ReportConnectionError reports with ModalIf.None, which never takes the modal branch); the modal-path gap is only a hypothetical.
  2. Re-entrant reports are suppressed from the user's view but still logged + sent to Sentry — the intended tradeoff.

Both are being surfaced to the developer as FYI/optional-hardening notes. CI (Greptile, pr-automation) is green.

@andrew-polk andrew-polk 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.

@andrew-polk reviewed 1 file and all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on StephenMcConnel).

@andrew-polk
andrew-polk merged commit fefc6ea into master Jul 30, 2026
3 of 4 checks passed
@andrew-polk
andrew-polk deleted the PreventInfiniteRecursionReportingError branch July 30, 2026 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants