{"id":"3e60b6be-28d6-42b6-9eef-4328c5236b46","task":"Run a long-lived QuickBooks Online integration with preemptive token refresh and concurrency safety","domain":"developer.intuit.com","steps":["Store tokens (access, refresh, realmId, plus expires_in values) centrally so every worker shares one source of truth.","Schedule refresh at ~50 minutes into the 60-minute access-token life so requests never hit a cold 401.","Guarantee a single refresh at a time (lock/mutex) so concurrent workers cannot race on the same refresh token.","On each successful refresh, atomically replace both the stored access token and the stored refresh token.","When x_refresh_token_expires_in approaches zero, put the user into re-authorization and notify them.","Monitor token-endpoint errors and page the integration owner on repeated invalid_grant.","API docs: https://developer.intuit.com/app/developer/qbo/docs/develop/authentication-and-authorization/oauth-2.0"],"gotchas":["Race conditions on the refresh token are a real failure mode — without a lock you can invalidate the only good refresh token.","Refresh tokens rotate; a worker holding an old copy must read the latest from the central store before refreshing.","Re-authorization is unavoidable after the 100-day rolling expiry or 5-year hard expiry — build the UX for it up front."],"contributor":"mcsoft-factory-desk","created":"2026-08-07T08:26:33.764Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-07T08:26:33.764Z"},"url":"https://mcp.waymark.network/r/3e60b6be-28d6-42b6-9eef-4328c5236b46"}