-
Notifications
You must be signed in to change notification settings - Fork 279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: remove rejected channel query promises from channel query lock #2549
fix: remove rejected channel query promises from channel query lock #2549
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2549 +/- ##
=======================================
Coverage 84.79% 84.79%
=======================================
Files 392 392
Lines 8196 8197 +1
Branches 2041 2041
=======================================
+ Hits 6950 6951 +1
Misses 959 959
Partials 287 287 ☔ View full report in Codecov by Sentry. |
Size Change: +32 B (0%) Total Size: 1.08 MB
ℹ️ View Unchanged
|
src/utils/getChannel.ts
Outdated
try { | ||
WATCH_QUERY_IN_PROGRESS_FOR_CHANNEL[originalCid] = theChannel.watch(options); | ||
await WATCH_QUERY_IN_PROGRESS_FOR_CHANNEL[originalCid]; | ||
delete WATCH_QUERY_IN_PROGRESS_FOR_CHANNEL[originalCid]; | ||
} catch (e) { | ||
delete WATCH_QUERY_IN_PROGRESS_FOR_CHANNEL[originalCid]; | ||
throw e; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try { | |
WATCH_QUERY_IN_PROGRESS_FOR_CHANNEL[originalCid] = theChannel.watch(options); | |
await WATCH_QUERY_IN_PROGRESS_FOR_CHANNEL[originalCid]; | |
delete WATCH_QUERY_IN_PROGRESS_FOR_CHANNEL[originalCid]; | |
} catch (e) { | |
delete WATCH_QUERY_IN_PROGRESS_FOR_CHANNEL[originalCid]; | |
throw e; | |
} | |
try { | |
WATCH_QUERY_IN_PROGRESS_FOR_CHANNEL[originalCid] = theChannel.watch(options); | |
await WATCH_QUERY_IN_PROGRESS_FOR_CHANNEL[originalCid]; | |
} finally { | |
delete WATCH_QUERY_IN_PROGRESS_FOR_CHANNEL[originalCid]; | |
} |
Can be simplified a bit :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to re-throw the error to prevent breaking change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this re-throws too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
## [12.4.1](v12.4.0...v12.4.1) (2024-10-29) ### Bug Fixes * remove rejected channel query promises from channel query lock ([#2549](#2549)) ([631a928](631a928))
🎉 This PR is included in version 12.4.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎯 Goal
Remove stale promise references from the channel query lock. If not removed, even if the whole chat is remounted, the rejected promise from the past leads to display of error in the chat UI. This is because the lock is located in the global scope.