Conversation
|
Thanks for looking into this @igorlukanin - I didn't have a good understanding of the mutex behaviour. |
johnhunter
left a comment
There was a problem hiding this comment.
Solution makes sense to me. Just the type fallout to resolve.
There was a problem hiding this comment.
Pull request overview
This PR addresses an issue where queries cancelled by mutex operations were resolving to undefined, causing unexpected behavior in components like useCubeQuery. The fix introduces explicit error handling for mutex cancellations and returns null instead.
Key changes:
- Introduces
MutexCancelledErrorclass to explicitly represent mutex cancellation events - Updates
mutexPromisefunction to throwMutexCancelledErrorinstead of silently swallowing errors - Adds error handling in
loadMethodto catchMutexCancelledErrorand returnnull
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Is this PR still active? The reported issue is #10261 |
…elled by mutex When multiple queries share the same mutexKey, newer queries invalidate older ones. Previously, cancelled queries would resolve to undefined because mutexPromise silently swallowed the MUTEX_ERROR without returning a value. This caused issues in useCubeQuery where resultSet would unexpectedly reset to undefined while isLoading remained false. Changes: - Add MutexCancelledError class for explicit mutex cancellation handling - Update mutexPromise to throw MutexCancelledError instead of swallowing errors - Catch MutexCancelledError in loadMethod and return null (a valid return type) Fixes #10261
… is cancelled by mutex" This reverts commit 0a2f5d1.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #10274 +/- ##
==========================================
+ Coverage 57.56% 57.64% +0.07%
==========================================
Files 222 222
Lines 17390 17392 +2
Branches 3561 3561
==========================================
+ Hits 10011 10026 +15
+ Misses 6843 6828 -15
- Partials 536 538 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
When multiple queries share the same mutexKey, newer queries invalidate older
ones. Previously, cancelled queries would resolve to undefined because
mutexPromise silently swallowed the MUTEX_ERROR without returning a value.
This caused issues in useCubeQuery where resultSet would unexpectedly reset
to undefined while isLoading remained false.
Changes:
Check List
Issue Reference this PR resolves
Fixes #10261
Conversation with Claude
claude.txt