(opts: LoadSubsetOptions)
| 1047 | * Inconsistent keys would cause refcount leaks and prevent proper cleanup. |
| 1048 | */ |
| 1049 | const generateQueryKeyFromOptions = (opts: LoadSubsetOptions): QueryKey => { |
| 1050 | if (typeof queryKey === `function`) { |
| 1051 | // Function-based queryKey: use it to build the key from opts |
| 1052 | return queryKey(opts) |
| 1053 | } else if (syncMode === `on-demand`) { |
| 1054 | // Static queryKey in on-demand mode: automatically append serialized predicates |
| 1055 | // to create separate cache entries for different predicate combinations |
| 1056 | const serialized = serializeLoadSubsetOptions(opts) |
| 1057 | return serialized !== undefined ? [...queryKey, serialized] : queryKey |
| 1058 | } else { |
| 1059 | // Static queryKey in eager mode: use as-is |
| 1060 | return queryKey |
| 1061 | } |
| 1062 | } |
| 1063 | |
| 1064 | const startupRetentionEntries = metadata?.collection.list( |
| 1065 | QUERY_COLLECTION_GC_PREFIX, |
no test coverage detected