fix(apps-engine): add missing await in AppSchedulerManager.cleanUp#39048
fix(apps-engine): add missing await in AppSchedulerManager.cleanUp#39048smirk-dev wants to merge 2 commits intoRocketChat:developfrom
Conversation
cancelAllJobs(appId) is an async bridge method but was called without await in cleanUp(). This causes a race condition during app uninstall: registered processors are cleared before cancellation finishes, so scheduled jobs firing in that window throw "Processor not available". On app reinstall, zombie jobs can accumulate since the old ones were never fully cancelled.
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
🦋 Changeset detectedLatest commit: e9765bc The changes in this PR will be included in the next version bump. This PR includes changesets to release 42 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
📜 Recent review details⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
🧰 Additional context used📓 Path-based instructions (1)**/*.{ts,tsx,js}📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)
Files:
🧠 Learnings (1)📚 Learning: 2026-02-24T19:09:01.522ZApplied to files:
🔇 Additional comments (2)
WalkthroughThis PR adds a missing Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #39048 +/- ##
===========================================
- Coverage 70.65% 70.64% -0.02%
===========================================
Files 3190 3190
Lines 112732 112732
Branches 20431 20438 +7
===========================================
- Hits 79649 79637 -12
- Misses 31035 31048 +13
+ Partials 2048 2047 -1
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Description
Adds a missing
awaitinAppSchedulerManager.cleanUp()to prevent a race condition during app uninstall/disable.Root Cause
cancelAllJobs(appId)is an async bridge method but was called fire-and-forget. ThecleanUpmethod resolves immediately while job cancellation is still in progress.Impact
When an app is uninstalled or disabled:
cleanUpreturns before cancellation completesthis.registeredProcessorswrapProcessorcallback throws"Processor ${processorId} not available"Fix
Testing
tsc --noEmitcleanSummary by CodeRabbit