Skip to content

stop trying to resubscribe after max attempts#7058

Closed
craigmichaelmartin wants to merge 1 commit into03-19-fix_infinite_401_retry_loop_when_app_logs_resubscribe_failsfrom
03-20-stop_trying_to_resubscribe_after_max_attempts
Closed

stop trying to resubscribe after max attempts#7058
craigmichaelmartin wants to merge 1 commit into03-19-fix_infinite_401_retry_loop_when_app_logs_resubscribe_failsfrom
03-20-stop_trying_to_resubscribe_after_max_attempts

Conversation

@craigmichaelmartin
Copy link
Contributor

@craigmichaelmartin craigmichaelmartin commented Mar 20, 2026

WHY are these changes introduced?

App log streaming sessions can become unstable due to network issues or authentication problems, causing repeated resubscribe failures that result in poor user experience with continuous retry attempts.

WHAT is this pull request doing?

Adds a maximum limit of 5 consecutive resubscribe failures before stopping app log polling and displaying a user-friendly message to restart the dev session. The implementation:

  • Introduces MAX_CONSECUTIVE_RESUBSCRIBE_FAILURES constant set to 5
  • Tracks consecutive resubscribe failures across polling cycles
  • Resets the failure counter on successful operations
  • Stops polling and shows "App log streaming session has expired. Please restart your dev session." when the limit is reached
  • Applies this logic to both development polling and JSON log rendering modes

How to test your changes?

  1. Start a dev session with app logs enabled
  2. Simulate network connectivity issues or authentication failures that cause resubscribe failures
  3. Verify that after 5 consecutive failures, polling stops and the appropriate message is displayed
  4. Test that successful resubscribes reset the failure counter
  5. Verify the behavior works in both UI and JSON output modes

Measuring impact

How do we know this change was effective? Please choose one:

  • n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes

Copy link
Contributor Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@craigmichaelmartin craigmichaelmartin marked this pull request as ready for review March 20, 2026 14:17
@craigmichaelmartin craigmichaelmartin requested a review from a team as a code owner March 20, 2026 14:17
@github-actions
Copy link
Contributor

We detected some changes at packages/*/src and there are no updates in the .changeset.
If the changes are user-facing, run pnpm changeset add to track your changes and include them in the next release CHANGELOG.

Caution

DO NOT create changesets for features which you do not wish to be included in the public changelog of the next CLI release.

@craigmichaelmartin
Copy link
Contributor Author

Decided to just fold this into #7055

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.

1 participant