Clarify some comments

This commit is contained in:
Eric Bailey
2026-01-08 09:59:09 -06:00
parent c2e5a18e42
commit 7dacf5916e
2 changed files with 11 additions and 1 deletions
+4
View File
@@ -146,6 +146,10 @@ export function useConfigQuery() {
* @see https://tanstack.com/query/latest/docs/framework/react/guides/initial-query-data#initial-data-from-the-cache-with-initialdataupdatedat
*/
staleTime: IS_DEV ? 5e3 : 1000 * 60 * 60,
/**
* N.B. if prefetch failed above, we'll have no `initialData`, and this
* query will run on startup.
*/
initialData: getConfigFromCache(),
initialDataUpdatedAt: () =>
qc.getQueryState(configQueryKey)?.dataUpdatedAt,
+7 -1
View File
@@ -30,7 +30,13 @@ export function useAgeAssuranceState(): AgeAssuranceState {
access: AgeAssuranceAccess.Safe,
}
// should never happen, but need to guard
/**
* This can happen if the prefetch fails (such as due to network issues).
* The query handler will try it again, but if it continues to fail, of
* course we won't have config.
*
* In this case, fail open (unknown status/access) to avoid blocking users.
*/
if (!config) {
logger.warn('useAgeAssuranceState: missing config')
return {