Estimator calls that survive a flaky upstream

A revoked token triggers one silent re-login and retry, a server error gets one backed-off retry, and a hung request aborts at 30 seconds so a sync ends with an error rather than spinning forever.

What it is

Three layered protections: a one-shot re-login on 401, a one-shot retry after a short delay on 5xx, and a hard client-side timeout with a jittered retry. Non-JSON and HTML responses are treated as transient rather than passed through as data.

Also called: SmartBuild 401 · spinner never stops · estimator timed out · pull latest hangs

See it
Estimator calls that survive a flaky upstream
🔒ridgelinepostframe.com/project/smartb607
40×64 Shop
Framing · on schedule
A retry ladder animation: 401 → re-login → success; 500 → wait 400ms → success; hang → abort at 30s → error toast. Sample data — no customer information appears here.
How it works
  1. 1A call uses the cached token; a 401 invalidates it, re-logs in and retries exactly once.
  2. 2A 5xx waits 400ms and retries once.
  3. 3The client wraps every call in a 30-second abort controller.
  4. 4An HTML body (auth redirect or a rebuild) is classed transient and retried once with backoff and jitter.
  5. 5Anything still failing surfaces as an error toast rather than a hang.
Why we built it

Each protection has a recorded cause. Token revocation: tokens 'can be revoked server-side earlier (password rotation, admin force-logout, server reset). Callers must call invalidateToken() on a 401 so the next request triggers a fresh /login instead of replaying a dead token until our local 23h expiry ticks over.' Server flakes: 'SmartBuild's API has shown intermittent 500-empty responses on read endpoints (GetStartingModel especially) for calls that succeeded moments earlier with identical inputs.' And the timeout is named after the bug it killed: 'the "Pull latest from SmartBuild" infinite-spinner bug. Without it, a fetch that never resolves left syncFromSmartBuild stuck.'

The problem
  • A revoked token was replayed for up to 23 hours.
  • Intermittent upstream 500s failed user actions that would have succeeded on retry.
  • A hung upstream left the sync spinner running forever.
Sound familiar?
What you get
Transient estimator failures are invisible to the user.
A password rotation does not break the day.
A stuck call ends cleanly with an error instead of a permanent spinner.

See it on your own jobs

Twenty minutes, your numbers, no slide deck. We’ll build one of your real buildings in front of you and send you the estimate link at the end — yours to keep either way.

or keep browsing features →