@ethlete/query 6.0.0-next.31 → 6.0.0-next.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @ethlete/query
2
2
 
3
+ ## 6.0.0-next.32
4
+
5
+ ### Patch Changes
6
+
7
+ - [`fcdf018`](https://github.com/ethlete-io/ethdk/commit/fcdf01864995a23bc850a748455357685ae90b6d) Thanks [@TomTomB](https://github.com/TomTomB)! - Fix token refresh causing an infinite loop
8
+
3
9
  ## 6.0.0-next.31
4
10
 
5
11
  ### Minor Changes
@@ -4625,7 +4625,11 @@ const createBearerAuthProviderImpl = (config) => {
4625
4625
  refreshToken.set(refresh);
4626
4626
  sessionStatus.set('authenticated');
4627
4627
  sessionEndCause.set(null);
4628
- afterTokenRefresh$.next();
4628
+ // Emit on the next microtask so that synchronous reactive work triggered by applying
4629
+ // the tokens (signals/effects) has a chance to settle before subscribers react.
4630
+ // This avoids rare races where a subscriber reacting to the emission would run
4631
+ // before other effects have fully applied the new token state.
4632
+ queueMicrotask(() => afterTokenRefresh$.next());
4629
4633
  };
4630
4634
  // Public entry point only - a query-driven login already reports its own, more specific
4631
4635
  // executionState (e.g. `{ type: 'login', state: 'success' }`) via setupBearerQueryRegistry's