Skip to content

Commit

Permalink
fix: remove rejected channel query promises from channel query lock (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinCupela authored Oct 29, 2024
1 parent aff47e8 commit 631a928
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/utils/getChannel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,12 @@ export const getChannel = async <
if (queryPromise) {
await queryPromise;
} else {
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];
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];
}
}

return theChannel;
Expand Down

0 comments on commit 631a928

Please sign in to comment.