@oxy.so/services 8.4.0 → 9.1.0
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/lib/commonjs/ui/components/BenefitList.js +1 -2
- package/lib/commonjs/ui/components/BenefitList.js.map +1 -1
- package/lib/commonjs/ui/components/OxyProvider.js +2 -2
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/context/OxyContext.js +4 -0
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/hooks/accountQueryPersistence.js +110 -80
- package/lib/commonjs/ui/hooks/accountQueryPersistence.js.map +1 -1
- package/lib/commonjs/ui/hooks/persistedQueryCache.js +101 -0
- package/lib/commonjs/ui/hooks/persistedQueryCache.js.map +1 -0
- package/lib/commonjs/ui/hooks/queryClient.js +43 -80
- package/lib/commonjs/ui/hooks/queryClient.js.map +1 -1
- package/lib/module/ui/components/BenefitList.js +1 -2
- package/lib/module/ui/components/BenefitList.js.map +1 -1
- package/lib/module/ui/components/OxyProvider.js +2 -2
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/context/OxyContext.js +4 -0
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/hooks/accountQueryPersistence.js +109 -80
- package/lib/module/ui/hooks/accountQueryPersistence.js.map +1 -1
- package/lib/module/ui/hooks/persistedQueryCache.js +94 -0
- package/lib/module/ui/hooks/persistedQueryCache.js.map +1 -0
- package/lib/module/ui/hooks/queryClient.js +44 -81
- package/lib/module/ui/hooks/queryClient.js.map +1 -1
- package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/accountQueryPersistence.d.ts +31 -13
- package/lib/typescript/commonjs/ui/hooks/accountQueryPersistence.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/persistedQueryCache.d.ts +44 -0
- package/lib/typescript/commonjs/ui/hooks/persistedQueryCache.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/hooks/queryClient.d.ts +15 -20
- package/lib/typescript/commonjs/ui/hooks/queryClient.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/icons/MaterialCommunityIcons.d.ts +1 -1
- package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/accountQueryPersistence.d.ts +31 -13
- package/lib/typescript/module/ui/hooks/accountQueryPersistence.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/persistedQueryCache.d.ts +44 -0
- package/lib/typescript/module/ui/hooks/persistedQueryCache.d.ts.map +1 -0
- package/lib/typescript/module/ui/hooks/queryClient.d.ts +15 -20
- package/lib/typescript/module/ui/hooks/queryClient.d.ts.map +1 -1
- package/lib/typescript/module/ui/icons/MaterialCommunityIcons.d.ts +1 -1
- package/package.json +4 -4
- package/src/ui/components/BenefitList.tsx +1 -1
- package/src/ui/components/OxyProvider.tsx +2 -2
- package/src/ui/context/OxyContext.tsx +4 -0
- package/src/ui/hooks/accountQueryPersistence.ts +138 -91
- package/src/ui/hooks/persistedQueryCache.ts +126 -0
- package/src/ui/hooks/queryClient.ts +55 -98
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactQuery","require","
|
|
1
|
+
{"version":3,"names":["_reactQuery","require","_persistedQueryCache","DEVICE_ROOTS","Set","accountQueryOwnership","config","memoryOnly","memoryOnlyRoots","SDK_MEMORY_ONLY_ROOTS","sdkRoots","PERSISTED_QUERY_PREFIXES","declared","roots","mutationHashes","mutationKeys","map","key","hashKey","ownsQuery","query","root","rootOf","has","persistsQuery","ownsMutation","mutation","options","mutationKey","undefined","ACCOUNT_QUERY_CACHE_KEY","exports","ACCOUNT_QUERY_CACHE_MAX_AGE","ACCOUNT_QUERY_PERSIST_THROTTLE_MS","storageKeyFor","accountId","encodeURIComponent","createAccountQueryPersistence","queryClient","filters","shouldDehydrateQuery","state","status","shouldDehydrateMutation","isPaused","listeners","resolveStorage","storageReady","Promise","resolve","hasStorage","io","enqueue","operation","then","catch","attached","restoredFor","generation","writer","notify","listener","dropScopedData","removeQueries","predicate","mutations","getMutationCache","getAll","remove","stopWriting","unsubscribe","restore","id","current","storage","raw","getItem","hydrateSnapshot","removeItem","subscribeSnapshots","serialized","target","setItem","setStorage","next","activate","previous","snapshot","attach","detach","flush","isReady","subscribe","add","delete"],"sourceRoot":"../../../../src","sources":["ui/hooks/accountQueryPersistence.ts"],"mappings":";;;;;;;;AAuBA,IAAAA,WAAA,GAAAC,OAAA;AAEA,IAAAC,oBAAA,GAAAD,OAAA;AAzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAcA;;AAwBA;;AASA;AACA,MAAME,YAAY,GAAG,IAAIC,GAAG,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;AAE1D,SAASC,qBAAqBA,CAACC,MAA4B,EAAyB;EACzF,MAAMC,UAAU,GAAG,IAAIH,GAAG,CAAC,CAAC,IAAIE,MAAM,CAACE,eAAe,IAAI,EAAE,CAAC,EAAE,GAAGC,0CAAqB,CAAC,CAAC;EACzF,MAAMC,QAAQ,GAAG,IAAIN,GAAG,CAACO,6CAAwB,CAAC;EAClD,MAAMC,QAAQ,GAAGN,MAAM,CAACO,KAAK,KAAK,KAAK,GAAG,IAAI,GAAG,IAAIT,GAAG,CAACE,MAAM,CAACO,KAAK,CAAC;EACtE,MAAMC,cAAc,GAAG,IAAIV,GAAG,CAAC,CAACE,MAAM,CAACS,YAAY,IAAI,EAAE,EAAEC,GAAG,CAAEC,GAAG,IAAK,IAAAC,mBAAO,EAACD,GAAG,CAAC,CAAC,CAAC;EAEtF,MAAME,SAAS,GAAIC,KAAY,IAAc;IAC3C,MAAMC,IAAI,GAAG,IAAAC,2BAAM,EAACF,KAAK,CAAC;IAC1B,IAAIC,IAAI,KAAK,IAAI,IAAId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CAAC;MACbZ,WAAW,GAAG,IAAI;IACpB,CAAC;IAEDkC,OAAOA,CAAA,EAAG;MACR,OAAOxD,SAAS,KAAK,IAAI,IAAIsB,WAAW,KAAKtB,SAAS;IACxD,CAAC;IAEDyD,SAASA,CAAC/B,QAAQ,EAAE;MAClBhB,SAAS,CAACgD,GAAG,CAAChC,QAAQ,CAAC;MACvB,OAAO,MAAM;QACXhB,SAAS,CAACiD,MAAM,CAACjC,QAAQ,CAAC;MAC5B,CAAC;IACH;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SDK_MEMORY_ONLY_ROOTS = exports.PERSISTED_QUERY_PREFIXES = void 0;
|
|
7
|
+
exports.hydrateSnapshot = hydrateSnapshot;
|
|
8
|
+
exports.rootOf = rootOf;
|
|
9
|
+
exports.snapshot = snapshot;
|
|
10
|
+
exports.subscribeSnapshots = subscribeSnapshots;
|
|
11
|
+
var _reactQuery = require("@tanstack/react-query");
|
|
12
|
+
var _buildId = require("../utils/buildId.js");
|
|
13
|
+
/**
|
|
14
|
+
* The storage format and restore rules shared by the SDK's two query caches:
|
|
15
|
+
* the account-agnostic one (`attachQueryPersistence`) and the per-account one
|
|
16
|
+
* (`createAccountQueryPersistence`).
|
|
17
|
+
*
|
|
18
|
+
* A blob is `{ buster, timestamp, clientState }`, TanStack's persisted-client
|
|
19
|
+
* shape. Restoring it treats its two halves differently:
|
|
20
|
+
*
|
|
21
|
+
* - Queries are served before any refetch, so a query written by another
|
|
22
|
+
* build, in whatever shape that build used, is dropped (`getOxyBuildId`).
|
|
23
|
+
* - Paused mutations are the user's queued actions (a star, a send made
|
|
24
|
+
* offline). A deploy must not lose them, so they are restored whatever build
|
|
25
|
+
* wrote them; the current build's `setMutationDefaults` replays them.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
/** The SDK's own account-agnostic query roots, persisted by `attachQueryPersistence`. */
|
|
29
|
+
const PERSISTED_QUERY_PREFIXES = exports.PERSISTED_QUERY_PREFIXES = ['accounts', 'users', 'sessions', 'devices', 'privacy'];
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* SDK queries whose data (or key) carries a signed, expiring URL. Never
|
|
33
|
+
* written to disk: a restored one would serve an expired URL.
|
|
34
|
+
*/
|
|
35
|
+
const SDK_MEMORY_ONLY_ROOTS = exports.SDK_MEMORY_ONLY_ROOTS = ['assetDownloadUrls', 'avatarCropSource', 'avatarCropMeasure', 'justifiedPhotoDimensions'];
|
|
36
|
+
function rootOf(query) {
|
|
37
|
+
const head = query.queryKey[0];
|
|
38
|
+
return typeof head === 'string' ? head : null;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** Serialize what the filters select, stamped with this build. */
|
|
42
|
+
function snapshot(queryClient, filters) {
|
|
43
|
+
const blob = {
|
|
44
|
+
buster: (0, _buildId.getOxyBuildId)(),
|
|
45
|
+
timestamp: Date.now(),
|
|
46
|
+
clientState: (0, _reactQuery.dehydrate)(queryClient, filters)
|
|
47
|
+
};
|
|
48
|
+
return JSON.stringify(blob);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Hydrate a stored blob into the client, synchronously, so a caller can check
|
|
53
|
+
* it is still wanted immediately before. Returns false when there was nothing
|
|
54
|
+
* usable (absent, unreadable or expired), in which case the caller removes it.
|
|
55
|
+
*/
|
|
56
|
+
function hydrateSnapshot(queryClient, raw, maxAge) {
|
|
57
|
+
if (!raw) return false;
|
|
58
|
+
let blob;
|
|
59
|
+
try {
|
|
60
|
+
blob = JSON.parse(raw);
|
|
61
|
+
} catch {
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
if (!blob?.clientState || typeof blob.timestamp !== 'number' || Date.now() - blob.timestamp > maxAge) {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
const sameBuild = blob.buster === (0, _buildId.getOxyBuildId)();
|
|
68
|
+
(0, _reactQuery.hydrate)(queryClient, {
|
|
69
|
+
queries: sameBuild ? blob.clientState.queries : [],
|
|
70
|
+
mutations: blob.clientState.mutations ?? []
|
|
71
|
+
});
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Write the filtered cache on every change, at most once per `throttleMs`.
|
|
77
|
+
* `write` receives the serialized snapshot; `flush()` writes now.
|
|
78
|
+
*/
|
|
79
|
+
function subscribeSnapshots(queryClient, filters, throttleMs, write) {
|
|
80
|
+
let timer = null;
|
|
81
|
+
const flush = () => {
|
|
82
|
+
if (timer) clearTimeout(timer);
|
|
83
|
+
timer = null;
|
|
84
|
+
write(snapshot(queryClient, filters));
|
|
85
|
+
};
|
|
86
|
+
const schedule = () => {
|
|
87
|
+
if (!timer) timer = setTimeout(flush, throttleMs);
|
|
88
|
+
};
|
|
89
|
+
const offQueries = queryClient.getQueryCache().subscribe(schedule);
|
|
90
|
+
const offMutations = queryClient.getMutationCache().subscribe(schedule);
|
|
91
|
+
return {
|
|
92
|
+
flush,
|
|
93
|
+
unsubscribe: () => {
|
|
94
|
+
if (timer) clearTimeout(timer);
|
|
95
|
+
timer = null;
|
|
96
|
+
offQueries();
|
|
97
|
+
offMutations();
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=persistedQueryCache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactQuery","require","_buildId","PERSISTED_QUERY_PREFIXES","exports","SDK_MEMORY_ONLY_ROOTS","rootOf","query","head","queryKey","snapshot","queryClient","filters","blob","buster","getOxyBuildId","timestamp","Date","now","clientState","dehydrate","JSON","stringify","hydrateSnapshot","raw","maxAge","parse","sameBuild","hydrate","queries","mutations","subscribeSnapshots","throttleMs","write","timer","flush","clearTimeout","schedule","setTimeout","offQueries","getQueryCache","subscribe","offMutations","getMutationCache","unsubscribe"],"sourceRoot":"../../../../src","sources":["ui/hooks/persistedQueryCache.ts"],"mappings":";;;;;;;;;;AAeA,IAAAA,WAAA,GAAAC,OAAA;AAQA,IAAAC,QAAA,GAAAD,OAAA;AAvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYA;AACO,MAAME,wBAA+C,GAAAC,OAAA,CAAAD,wBAAA,GAAG,CAC7D,UAAU,EACV,OAAO,EACP,UAAU,EACV,SAAS,EACT,SAAS,CACV;;AAED;AACA;AACA;AACA;AACO,MAAME,qBAA4C,GAAAD,OAAA,CAAAC,qBAAA,GAAG,CAC1D,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,0BAA0B,CAC3B;AAaM,SAASC,MAAMA,CAACC,KAAY,EAAiB;EAClD,MAAMC,IAAI,GAAGD,KAAK,CAACE,QAAQ,CAAC,CAAC,CAAC;EAC9B,OAAO,OAAOD,IAAI,KAAK,QAAQ,GAAGA,IAAI,GAAG,IAAI;AAC/C;;AAEA;AACO,SAASE,QAAQA,CAACC,WAAwB,EAAEC,OAAuB,EAAU;EAClF,MAAMC,IAAmB,GAAG;IAC1BC,MAAM,EAAE,IAAAC,sBAAa,EAAC,CAAC;IACvBC,SAAS,EAAEC,IAAI,CAACC,GAAG,CAAC,CAAC;IACrBC,WAAW,EAAE,IAAAC,qBAAS,EAACT,WAAW,EAAEC,OAAO;EAC7C,CAAC;EACD,OAAOS,IAAI,CAACC,SAAS,CAACT,IAAI,CAAC;AAC7B;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASU,eAAeA,CAACZ,WAAwB,EAAEa,GAAkB,EAAEC,MAAc,EAAW;EACrG,IAAI,CAACD,GAAG,EAAE,OAAO,KAAK;EACtB,IAAIX,IAAmB;EACvB,IAAI;IACFA,IAAI,GAAGQ,IAAI,CAACK,KAAK,CAACF,GAAG,CAAkB;EACzC,CAAC,CAAC,MAAM;I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AACF,KAAK,CAAC;MAC9BA,KAAK,GAAG,IAAI;MACZK,UAAU,CAAC,CAAC;MACZG,YAAY,CAAC,CAAC;IAChB;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -6,10 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.createQueryClient = exports.clearQueryCache = exports.attachQueryPersistence = void 0;
|
|
7
7
|
exports.shouldRetryQuery = shouldRetryQuery;
|
|
8
8
|
var _reactQuery = require("@tanstack/react-query");
|
|
9
|
-
var _reactQueryPersistClient = require("@tanstack/react-query-persist-client");
|
|
10
|
-
var _queryAsyncStoragePersister = require("@tanstack/query-async-storage-persister");
|
|
11
9
|
var _core = require("@oxy.so/core");
|
|
12
|
-
var
|
|
10
|
+
var _accountQueryPersistence = require("./accountQueryPersistence.js");
|
|
11
|
+
var _persistedQueryCache = require("./persistedQueryCache.js");
|
|
13
12
|
/**
|
|
14
13
|
* Offline-first QueryClient with cross-restart persistence.
|
|
15
14
|
*
|
|
@@ -17,23 +16,20 @@ var _buildId = require("../utils/buildId.js");
|
|
|
17
16
|
* - TanStack Query with `networkMode: 'offlineFirst'` for queries and mutations
|
|
18
17
|
* so cached data is served immediately and mutations are queued (paused) while
|
|
19
18
|
* the browser/device reports offline.
|
|
20
|
-
* - `
|
|
21
|
-
*
|
|
19
|
+
* - `attachQueryPersistence(...)` so that query results AND paused mutations
|
|
20
|
+
* survive a cold restart (kill-and-relaunch); see `persistedQueryCache.ts`.
|
|
22
21
|
* - `onlineManager` resume hook so paused mutations replay the moment the
|
|
23
22
|
* network is reported back, even if the host app swapped in a custom
|
|
24
23
|
* onlineManager implementation.
|
|
25
24
|
*
|
|
26
|
-
* Storage layer:
|
|
27
|
-
*
|
|
28
|
-
* - Web -> localStorage via `createSyncStoragePersister` (wrapped in the
|
|
29
|
-
* async persister API for a single call site).
|
|
30
|
-
* - Both adapters are content-shape compatible with our `StorageInterface`.
|
|
25
|
+
* Storage layer: the platform `StorageInterface` (AsyncStorage on native,
|
|
26
|
+
* localStorage on web).
|
|
31
27
|
*
|
|
32
28
|
* Whitelist policy:
|
|
33
29
|
* - Persist every account/user/session/privacy query and every queued mutation.
|
|
34
30
|
* - DO NOT persist large list queries (e.g. activity feeds) — they go stale
|
|
35
31
|
* fast and would balloon storage. Add new keys to `PERSISTED_QUERY_PREFIXES`
|
|
36
|
-
* when introducing reads that should survive restart.
|
|
32
|
+
* (`persistedQueryCache.ts`) when introducing reads that should survive restart.
|
|
37
33
|
*/
|
|
38
34
|
|
|
39
35
|
const QUERY_CACHE_KEY = 'oxy_query_cache_v3';
|
|
@@ -55,46 +51,16 @@ function shouldRetryQuery(failureCount, error) {
|
|
|
55
51
|
}
|
|
56
52
|
|
|
57
53
|
/**
|
|
58
|
-
*
|
|
59
|
-
* is
|
|
60
|
-
*
|
|
61
|
-
* Mutations are persisted independently (always) so the offline write queue
|
|
62
|
-
* works regardless of the read whitelist.
|
|
54
|
+
* Whether a query belongs in the account-agnostic cache: successful (a
|
|
55
|
+
* `pending`/`error` state is not worth keeping, and an error would leak
|
|
56
|
+
* failure objects across restarts) and under one of the SDK's own prefixes.
|
|
63
57
|
*/
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Adapt our `StorageInterface` (which always returns `null` for missing keys)
|
|
68
|
-
* to TanStack's `AsyncStorage` shape. The two are structurally identical
|
|
69
|
-
* apart from naming; this also gives us a single place to add error
|
|
70
|
-
* suppression if a host platform's storage throws.
|
|
71
|
-
*/
|
|
72
|
-
function adaptStorage(storage) {
|
|
73
|
-
return {
|
|
74
|
-
getItem: key => storage.getItem(key),
|
|
75
|
-
setItem: (key, value) => storage.setItem(key, value),
|
|
76
|
-
removeItem: key => storage.removeItem(key)
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Decide whether a given query should be written to persistent storage.
|
|
82
|
-
*
|
|
83
|
-
* Two gates:
|
|
84
|
-
* 1. The query must be in our prefix whitelist.
|
|
85
|
-
* 2. The query must have completed successfully at least once — there's no
|
|
86
|
-
* point persisting a `pending`/`error` state, and persisting `error` would
|
|
87
|
-
* leak failure objects across restarts.
|
|
88
|
-
*/
|
|
89
|
-
function shouldDehydrateQuery(query) {
|
|
58
|
+
function isSharedQuery(query) {
|
|
90
59
|
if (query.state.status !== 'success') {
|
|
91
60
|
return false;
|
|
92
61
|
}
|
|
93
62
|
const head = query.queryKey[0];
|
|
94
|
-
|
|
95
|
-
return false;
|
|
96
|
-
}
|
|
97
|
-
return PERSISTED_QUERY_PREFIXES.includes(head);
|
|
63
|
+
return typeof head === 'string' && _persistedQueryCache.PERSISTED_QUERY_PREFIXES.includes(head);
|
|
98
64
|
}
|
|
99
65
|
|
|
100
66
|
/**
|
|
@@ -154,58 +120,55 @@ const createQueryClient = () => {
|
|
|
154
120
|
};
|
|
155
121
|
exports.createQueryClient = createQueryClient;
|
|
156
122
|
/**
|
|
157
|
-
*
|
|
123
|
+
* Restore, then keep writing, the account-agnostic cache.
|
|
158
124
|
*
|
|
159
|
-
*
|
|
160
|
-
* `
|
|
125
|
+
* Queries written by another build are dropped; queued mutations are kept
|
|
126
|
+
* (`persistedQueryCache.ts`). Whatever the app declared account-scoped
|
|
127
|
+
* (`accountQueries`) is left to `createAccountQueryPersistence`, even under
|
|
128
|
+
* one of the SDK's prefixes, so private rows never land in the shared blob and
|
|
129
|
+
* a paused mutation cannot replay twice or under another account.
|
|
161
130
|
*
|
|
162
131
|
* Safe to no-op if `storage` is null/undefined (e.g. server-side render
|
|
163
132
|
* with no host storage).
|
|
164
133
|
*/
|
|
165
|
-
const attachQueryPersistence = (queryClient, storage,
|
|
166
|
-
/**
|
|
167
|
-
* Mutation keys the app declared account-scoped (`accountQueries`). Those are
|
|
168
|
-
* persisted per account by `createAccountQueryPersistence`, never here, so a
|
|
169
|
-
* paused mutation cannot replay twice or under another account.
|
|
170
|
-
*/
|
|
171
|
-
accountMutationKeys = []) => {
|
|
134
|
+
const attachQueryPersistence = (queryClient, storage, accountQueries) => {
|
|
172
135
|
if (!storage) {
|
|
173
136
|
return {
|
|
174
137
|
restored: Promise.resolve(),
|
|
175
138
|
unsubscribe: () => {}
|
|
176
139
|
};
|
|
177
140
|
}
|
|
178
|
-
const
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
// Persist every other mutation regardless of status: paused mutations are
|
|
185
|
-
// exactly the ones that must survive restart to replay when online.
|
|
186
|
-
const accountScoped = new Set(accountMutationKeys.map(key => (0, _reactQuery.hashKey)(key)));
|
|
187
|
-
const shouldDehydrateMutation = mutation => {
|
|
188
|
-
const key = mutation.options.mutationKey;
|
|
189
|
-
return key === undefined || !accountScoped.has((0, _reactQuery.hashKey)(key));
|
|
141
|
+
const account = accountQueries ? (0, _accountQueryPersistence.accountQueryOwnership)(accountQueries) : null;
|
|
142
|
+
const filters = {
|
|
143
|
+
shouldDehydrateQuery: query => isSharedQuery(query) && !(account?.ownsQuery(query) ?? false),
|
|
144
|
+
// Every other mutation, whatever its status: paused ones are exactly the
|
|
145
|
+
// ones that must survive a restart to replay when online.
|
|
146
|
+
shouldDehydrateMutation: mutation => !(account?.ownsMutation(mutation) ?? false)
|
|
190
147
|
};
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
shouldDehydrateMutation
|
|
148
|
+
let stopped = false;
|
|
149
|
+
let writer = null;
|
|
150
|
+
const restored = (async () => {
|
|
151
|
+
const raw = await storage.getItem(QUERY_CACHE_KEY);
|
|
152
|
+
if (stopped) return;
|
|
153
|
+
if (!(0, _persistedQueryCache.hydrateSnapshot)(queryClient, raw, QUERY_CACHE_MAX_AGE) && raw) {
|
|
154
|
+
await storage.removeItem(QUERY_CACHE_KEY);
|
|
199
155
|
}
|
|
200
|
-
})
|
|
201
|
-
restored.catch(error => {
|
|
156
|
+
})().catch(error => {
|
|
202
157
|
if ((0, _core.isDev)()) {
|
|
203
158
|
console.warn('[QueryClient] Failed to restore persisted cache', error);
|
|
204
159
|
}
|
|
160
|
+
}).then(() => {
|
|
161
|
+
if (stopped) return;
|
|
162
|
+
writer = (0, _persistedQueryCache.subscribeSnapshots)(queryClient, filters, QUERY_PERSIST_THROTTLE_MS, serialized => {
|
|
163
|
+
void Promise.resolve(storage.setItem(QUERY_CACHE_KEY, serialized)).catch(() => undefined);
|
|
164
|
+
});
|
|
205
165
|
});
|
|
206
166
|
return {
|
|
207
|
-
|
|
208
|
-
|
|
167
|
+
restored,
|
|
168
|
+
unsubscribe: () => {
|
|
169
|
+
stopped = true;
|
|
170
|
+
writer?.unsubscribe();
|
|
171
|
+
}
|
|
209
172
|
};
|
|
210
173
|
};
|
|
211
174
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactQuery","require","
|
|
1
|
+
{"version":3,"names":["_reactQuery","require","_core","_accountQueryPersistence","_persistedQueryCache","QUERY_CACHE_KEY","QUERY_CACHE_MAX_AGE","QUERY_PERSIST_THROTTLE_MS","MAX_QUERY_RETRIES","statusOf","error","value","status","response","shouldRetryQuery","failureCount","isSharedQuery","query","state","head","queryKey","PERSISTED_QUERY_PREFIXES","includes","createQueryClient","client","QueryClient","defaultOptions","queries","staleTime","gcTime","retry","retryDelay","attemptIndex","Math","min","refetchOnReconnect","refetchOnWindowFocus","networkMode","mutations","unsubscribe","onlineManager","subscribe","isOnline","getMutationCache","resumePausedMutations","Object","defineProperty","enumerable","configurable","writable","exports","attachQueryPersistence","queryClient","storage","accountQueries","restored","Promise","resolve","account","accountQueryOwnership","filters","shouldDehydrateQuery","ownsQuery","shouldDehydrateMutation","mutation","ownsMutation","stopped","writer","raw","getItem","hydrateSnapshot","removeItem","catch","isDev","console","warn","then","subscribeSnapshots","serialized","setItem","undefined","clearQueryCache"],"sourceRoot":"../../../../src","sources":["ui/hooks/queryClient.ts"],"mappings":";;;;;;;AAuBA,IAAA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,GAAG,IAAAU,uCAAkB,EAACzB,WAAW,EAAEQ,OAAO,EAAErD,yBAAyB,EAAGuE,UAAU,IAAK;MAC3F,KAAKtB,OAAO,CAACC,OAAO,CAACJ,OAAO,CAAC0B,OAAO,CAAC1E,eAAe,EAAEyE,UAAU,CAAC,CAAC,CAACN,KAAK,CAAC,MAAMQ,SAAS,CAAC;IAC3F,CAAC,CAAC;EACJ,CAAC,CAAC;EAEJ,OAAO;IACLzB,QAAQ;IACRhB,WAAW,EAAEA,CAAA,KAAM;MACjB2B,OAAO,GAAG,IAAI;MACdC,MAAM,EAAE5B,WAAW,CAAC,CAAC;IACvB;EACF,CAAC;AACH,CAAC;;AAED;AACA;AACA;AACA;AAHAW,OAAA,CAAAC,sBAAA,GAAAA,sBAAA;AAIO,MAAM8B,eAAe,GAAG,MAAO5B,OAAyB,IAAoB;EACjF,IAAI;IACF,MAAMA,OAAO,CAACkB,UAAU,CAAClE,eAAe,CAAC;EAC3C,CAAC,CAAC,OAAOK,KAAK,EAAE;IACd,IAAI,IAAA+D,WAAK,EAAC,CAAC,EAAE;MACXC,OAAO,CAACC,IAAI,CAAC,qDAAqD,EAAEjE,KAAK,CAAC;IAC5E;EACF;AACF,CAAC;;AAED;AACA;AACA;AAFAwC,OAAA,CAAA+B,eAAA,GAAAA,eAAA","ignoreList":[]}
|
|
@@ -80,8 +80,7 @@ export const BenefitList = ({
|
|
|
80
80
|
className: className,
|
|
81
81
|
style: [{
|
|
82
82
|
padding: SPACING['space-16'],
|
|
83
|
-
gap: SPACING['space-16']
|
|
84
|
-
overflow: 'visible'
|
|
83
|
+
gap: SPACING['space-16']
|
|
85
84
|
}, style],
|
|
86
85
|
accessibilityLabel: accessibilityLabel,
|
|
87
86
|
children: children
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["View","Card","RADIUS","SPACING","TYPOGRAPHY","useTheme","Text","jsx","_jsx","jsxs","_jsxs","ICON_SQUARE_SIZE","BenefitRow","icon","label","children","accessibilityLabel","className","style","textStyle","colors","content","a11y","undefined","flexDirection","alignItems","gap","accessibilityRole","width","height","borderRadius","justifyContent","backgroundColor","backgroundTertiary","accessibilityElementsHidden","flex","fontSize","caption","size","lineHeight","fontWeight","weight","color","textSecondary","BenefitList","variant","radius","border","elevation","padding"
|
|
1
|
+
{"version":3,"names":["View","Card","RADIUS","SPACING","TYPOGRAPHY","useTheme","Text","jsx","_jsx","jsxs","_jsxs","ICON_SQUARE_SIZE","BenefitRow","icon","label","children","accessibilityLabel","className","style","textStyle","colors","content","a11y","undefined","flexDirection","alignItems","gap","accessibilityRole","width","height","borderRadius","justifyContent","backgroundColor","backgroundTertiary","accessibilityElementsHidden","flex","fontSize","caption","size","lineHeight","fontWeight","weight","color","textSecondary","BenefitList","variant","radius","border","elevation","padding"],"sourceRoot":"../../../../src","sources":["ui/components/BenefitList.tsx"],"mappings":";;AACA,SAASA,IAAI,QAAwD,cAAc;AACnF,SAASC,IAAI,QAAQ,oBAAoB;AACzC,SAASC,MAAM,EAAEC,OAAO,EAAEC,UAAU,QAAQ,6BAA6B;AACzE,SAASC,QAAQ,QAAQ,qBAAqB;AAC9C,SAASC,IAAI,QAAQ,0BAA0B;;AAE/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AACA,MAAMC,gBAAgB,GAAG,EAAE;AAgB3B,OAAO,MAAMC,UAAqC,GAAGA,CAAC;EAClDC,IAAI;EACJC,KAAK;EACLC,QAAQ;EACRC,kBAAkB;EAClBC,SAAS;EACTC,KAAK;EACLC;AACJ,CAAC,KAAK;EACF,MAAM;IAAEC;EAAO,CAAC,GAAGf,QAAQ,CAAC,CAAC;EAC7B,MAAMgB,OAAO,GAAGN,QAAQ,IAAID,KAAK;EACjC,MAAMQ,IAAI,GAAGN,kBAAkB,KAAK,OAAOK,OAAO,KAAK,QAAQ,GAAGA,OAAO,GAAGE,SAAS,CAAC;EAEt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AAG;EACb/B,SAAS,EAAEA,SAAU;EACrBC,KAAK,EAAE,CAAC;IAAE+B,OAAO,EAAE9C,OAAO,CAAC,UAAU,CAAC;IAAEuB,GAAG,EAAEvB,OAAO,CAAC,UAAU;EAAE,CAAC,EAAEe,KAAK,CAAE;EAC3EF,kBAAkB,EAAEA,kBAAmB;EAAAD,QAAA,EAEtCA;AAAQ,CACP,CACT","ignoreList":[]}
|
|
@@ -105,7 +105,7 @@ const OxyProvider = ({
|
|
|
105
105
|
const persistenceUnsubRef = useRef(null);
|
|
106
106
|
const ownsQueryClientRef = useRef(providedQueryClient === undefined);
|
|
107
107
|
// `accountQueries` is read once, at mount, like the client itself.
|
|
108
|
-
const
|
|
108
|
+
const accountQueriesRef = useRef(accountQueries);
|
|
109
109
|
const [platformStorage, setPlatformStorage] = useState(null);
|
|
110
110
|
|
|
111
111
|
// If the consumer supplied their own QueryClient we use it as-is and skip
|
|
@@ -137,7 +137,7 @@ const OxyProvider = ({
|
|
|
137
137
|
setPlatformStorage(storage);
|
|
138
138
|
const client = queryClientRef.current;
|
|
139
139
|
if (!client || !ownsQueryClientRef.current) return;
|
|
140
|
-
const persistence = attachQueryPersistence(client, storage,
|
|
140
|
+
const persistence = attachQueryPersistence(client, storage, accountQueriesRef.current);
|
|
141
141
|
persistenceUnsubRef.current = persistence.unsubscribe;
|
|
142
142
|
await persistence.restored;
|
|
143
143
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useEffect","useRef","useState","AppState","Platform","StyleSheet","GestureHandlerRootView","SafeAreaProvider","OxyRuntimeProvider","QueryClientProvider","focusManager","onlineManager","SurfaceProvider","ToastOutlet","logger","loggerUtil","RequireOxyAuth","attachQueryPersistence","createQueryClient","createMemoryStorage","createPlatformStorage","isNetConnectivityOnline","KeyboardBoundary","ProductAnalyticsObserver","LanguageBridge","BloomLocaleBridge","jsx","_jsx","jsxs","_jsxs","bootStyles","create","providerRoot","flex","isWeb","OS","OxyProvider","oxyServices","children","onAuthStateChange","productAnalytics","storageKeyPrefix","clientId","baseURL","authWebUrl","authRedirectUri","authorizeBaseUrl","sessionMode","webAuthMode","queryClient","providedQueryClient","accountQueries","requireAuth","backgroundSession","language","queryClientRef","persistenceUnsubRef","ownsQueryClientRef","undefined","
|
|
1
|
+
{"version":3,"names":["useEffect","useRef","useState","AppState","Platform","StyleSheet","GestureHandlerRootView","SafeAreaProvider","OxyRuntimeProvider","QueryClientProvider","focusManager","onlineManager","SurfaceProvider","ToastOutlet","logger","loggerUtil","RequireOxyAuth","attachQueryPersistence","createQueryClient","createMemoryStorage","createPlatformStorage","isNetConnectivityOnline","KeyboardBoundary","ProductAnalyticsObserver","LanguageBridge","BloomLocaleBridge","jsx","_jsx","jsxs","_jsxs","bootStyles","create","providerRoot","flex","isWeb","OS","OxyProvider","oxyServices","children","onAuthStateChange","productAnalytics","storageKeyPrefix","clientId","baseURL","authWebUrl","authRedirectUri","authorizeBaseUrl","sessionMode","webAuthMode","queryClient","providedQueryClient","accountQueries","requireAuth","backgroundSession","language","queryClientRef","persistenceUnsubRef","ownsQueryClientRef","undefined","accountQueriesRef","platformStorage","setPlatformStorage","current","client","mounted","bootstrap","storage","error","__DEV__","warn","component","persistence","unsubscribe","restored","handleVisibilityChange","setFocused","document","visibilityState","addEventListener","removeEventListener","subscription","state","remove","cleanup","setupNetworkMonitoring","setOnline","navigator","onLine","handleOnline","handleOffline","window","NetInfo","default","fetch","coreContent","analytics","prompt","style"],"sourceRoot":"../../../../src","sources":["ui/components/OxyProvider.tsx"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAiB,OAAO;AAC5D,SAASC,QAAQ,EAAEC,QAAQ,EAAEC,UAAU,QAAQ,cAAc;AAC7D,SAASC,sBAAsB,QAAQ,8BAA8B;AACrE,SAASC,gBAAgB,QAAQ,gCAAgC;AAEjE,SAASC,kBAAkB,QAAsC,0BAAuB;AACxF,SAASC,mBAAmB,EAAEC,YAAY,EAAEC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L;EAAC,CACC,CAAC;AAEjC,CAAC;AAED,eAAe1D,WAAW","ignoreList":[]}
|
|
@@ -229,6 +229,10 @@ export const OxyRuntimeProvider = ({
|
|
|
229
229
|
accountQueryPersistenceRef.current = accountQueries ? createAccountQueryPersistence(queryClient, accountQueries) : null;
|
|
230
230
|
}
|
|
231
231
|
const accountQueryPersistence = accountQueryPersistenceRef.current;
|
|
232
|
+
useEffect(() => {
|
|
233
|
+
accountQueryPersistence?.attach();
|
|
234
|
+
return () => accountQueryPersistence?.detach();
|
|
235
|
+
}, [accountQueryPersistence]);
|
|
232
236
|
const isAccountCacheReady = useSyncExternalStore(accountQueryPersistence ? accountQueryPersistence.subscribe : subscribeNever, () => accountQueryPersistence?.isReady() ?? true, () => accountQueryPersistence?.isReady() ?? true);
|
|
233
237
|
const storageRef = useRef(null);
|
|
234
238
|
const [storage, setStorage] = useState(null);
|