fix(fetch): bump tenant generation only when the access token changes (MAPPS-187) #176
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/MAPPS-187-double-fetch"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Fix the mount-time double-fetch of list resources.
set_access_tokenbumpedTENANT_GENERATIONon every call, and startup sets the same token twice (OIDC callback, then rehydration /complete_login). Everyuse_resourcethat readsactive_tenant_generation()(timesheets, time-entries, and other list pages) therefore ran twice on mount.Change
set_access_tokennow bumps the generation only when the token actually changes:Safe by construction: the only behavior change is skipping a refetch when the token did not change, which was wasted work.
Scope / verification notes
UpdateBanner/versioncheck keys on the auth context, not the generation, so its duplicate may need a separate follow-up (noted on the issue).cargo check --target wasm32-unknown-unknown).Testing
cargo fmt --all --check,cargo clippy --all-targets -- -D warnings,cargo check --target wasm32-unknown-unknown: all clean (rust-builder container).