Skip to content

fix: reset summaryInFlight to false in onSuspend to prevent permanent summarization lock#748

Open
nyxsky404 wants to merge 2 commits into
shouri123:mainfrom
nyxsky404:fix/summary-inflight-on-suspend-736
Open

fix: reset summaryInFlight to false in onSuspend to prevent permanent summarization lock#748
nyxsky404 wants to merge 2 commits into
shouri123:mainfrom
nyxsky404:fix/summary-inflight-on-suspend-736

Conversation

@nyxsky404

Copy link
Copy Markdown
Contributor

Description

summaryInFlight is a module-level boolean that prevents concurrent summarizations. When the service worker is suspended by Chrome mid-API call, the onSuspend handler was persisting summaryInFlight = true into chrome.storage.local. On the next worker restart, hydrateState() restores this value — permanently blocking all future calls to summarizeTranscriptIfNeeded() for the rest of the session, since the flag is never reset (the finally block that resets it never ran because the worker was killed).

The fix resets summaryInFlight = false inside onSuspend before persisting the guard state. A suspended worker cannot complete an async API call, so carrying the flag forward serves no purpose and causes the described lock.

Fixes #736

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • All 133 existing tests pass (npm test)
  • Build succeeds (npm run build)

… lock

When the service worker is suspended mid-API call, the async summarization
promise is abandoned. The onSuspend handler was persisting summaryInFlight
as true into chrome.storage.local, causing hydrateState() on the next
worker restart to restore it as true — permanently blocking all future
summarizations for the session with no user-visible error.

Reset summaryInFlight to false before persisting the guard state so the
restarted worker begins with a clean summarization slot.

Fixes shouri123#736
@nyxsky404 nyxsky404 requested a review from shouri123 as a code owner June 12, 2026 17:10
Copilot AI review requested due to automatic review settings June 12, 2026 17:10
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Thank You for Contributing to Late-Meet

Please ensure that:

  • the issue was assigned to you before opening this PR
  • the PR references the related issue
  • your changes follow repository contribution guidelines
  • the project builds successfully before submission

Unassigned, duplicate, or low-quality PRs may be closed.

Thank you for contributing 💙

@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@nyxsky404, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 58 minutes and 52 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4cbd39cc-e7dd-4d3f-8f92-b0839df0b6f1

📥 Commits

Reviewing files that changed from the base of the PR and between 199edfc and 69d0f3f.

📒 Files selected for processing (1)
  • src/background.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added type:code Type: Code change security-review Requires security review before merge gssoc Official GSSoC contribution issue gssoc:approved GSSoC: PR approved and scored bug Something isn't working size/XS type:design Type: Design / UI / UX (Optional bonus) labels Jun 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

👋 Thank you @nyxsky404 for your contribution to Late-Meet!

✅ Verified: You are assigned to the linked issue #736.

Please review any automated suggestions or code review comments that may appear below! We will review your PR as soon as possible!


Please consider starring the repository ⭐ to show your support!

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.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Prevents summarization from getting permanently blocked across service worker restarts by clearing the summaryInFlight guard during chrome.runtime.onSuspend.

Changes:

  • Reset summaryInFlight to false on service worker suspension to avoid restoring a stale “in-flight” state.
  • Add explanatory comment documenting why the guard must be cleared before persisting hydration flags.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/background.ts
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working gssoc:approved GSSoC: PR approved and scored gssoc Official GSSoC contribution issue security-review Requires security review before merge size/XS type:code Type: Code change type:design Type: Design / UI / UX (Optional bonus)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] summaryInFlight stuck true after service worker suspension mid-API call

2 participants