@ethlete/query 5.30.1 → 5.30.2
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
|
+
## 5.30.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`7726bcd`](https://github.com/ethlete-io/ethdk/commit/7726bcd4ed5719718a3b6bb3d56cba05522be91b) Thanks [@TomTomB](https://github.com/TomTomB)! - Secure query race condition
|
|
8
|
+
|
|
3
9
|
## 5.30.1
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -4424,7 +4424,10 @@ const createSecureExecuteFn = (options) => {
|
|
|
4424
4424
|
authQuerySubscription = Subscription.EMPTY;
|
|
4425
4425
|
cleanupPreviousExecute({ executeOptions: options, executeState });
|
|
4426
4426
|
const authQuery = authProvider.latestExecutedQuery();
|
|
4427
|
-
if
|
|
4427
|
+
// This might happen if a secure query gets executed while the auth query has just been created.
|
|
4428
|
+
// This is due to the fact that the query state is being synced with the state inside the http request using effect.
|
|
4429
|
+
const isAuthQueryFreshlyExecuted = authQuery?.lastTimeExecutedAt() === null;
|
|
4430
|
+
if (!authQuery || authQuery.loading() || isAuthQueryFreshlyExecuted) {
|
|
4428
4431
|
options.state.loading.set({ executeTime: Date.now(), progress: null });
|
|
4429
4432
|
authQuerySubscription = toObservable(authProvider.latestExecutedQuery, { injector: options.deps.injector })
|
|
4430
4433
|
.pipe(switchMap((query) => {
|