diff --git a/docs/TROUBLESHOOTING.md b/docs/TROUBLESHOOTING.md index 0f003df03d..e83fe7b4e3 100644 --- a/docs/TROUBLESHOOTING.md +++ b/docs/TROUBLESHOOTING.md @@ -35,6 +35,8 @@ Common issues and how to resolve them. **Prevention**: Bookmark `/fix-cache.html` or use the link in Settings → Fix app. Since v2.813 the app also updates itself properly: the app reloads itself onto a new deploy at a quiet moment (first paint before any touch, a route change — a new page or a new `?tab=` (v2.4214) — with nothing open, idle — hidden 5 min or untouched 30 min — with nothing unsaved and no write in flight, never over words someone typed and has not sent (v2.8499, `pageHoldsTypedText`), and looked at a second time when the reload would fire, where a write is waited out and a touch, typed words or anything open hands it to the pill (v2.7600): [src/lib/autoReload.ts](../src/lib/autoReload.ts), [src/lib/unsavedWork.ts](../src/lib/unsavedWork.ts); inline editors keep a per-tab draft that comes back after the reload, [src/lib/reloadDraft.ts](../src/lib/reloadDraft.ts); v2.3740–v2.3742) and otherwise shows the "A new version is ready" pill (prompt-mode service worker, [src/components/UpdatePrompt.tsx](../src/components/UpdatePrompt.tsx)), whose **Reload** over typed words reloads nothing at first: the page is walked through each place that holds them, ringed for a second, and the press becomes **Reload anyway** (v2.8499, `src/lib/typedTextTour.ts`, `src/lib/updatePillWarn.ts`); the gear menu's **Hard Reload** and **Reload** on a page that could not load ask the same way through one bar (v2.8513, `src/lib/reloadOverWords.ts`, `src/components/ReloadOverWordsBar.tsx`) and long-lived tabs check for updates hourly and on tab re-focus — stale builds, the raw material for these white screens, should now be rare. +**Slow for one person, not stuck (v2.9273)**: do not send them to Fix app, which clears the cached files and measures nothing. Have them press **Check my connection** in the Fix app box at Settings → Advanced (`ConnectionCheckCard.tsx`, kernel `src/lib/connectionCheck.ts`) and paste **Copy the report** back. It times the site, the API's health address, their own `users` row and the Bids list read, three tries each, and its top sentence says whether the slow part is their connection or the app's own reads. Nothing is kept or sent. Helpers and subcontractors do not have Advanced. + --- ## Supabase database unresponsive / high disk I/O diff --git a/docs/recent-features/v2.9273.md b/docs/recent-features/v2.9273.md new file mode 100644 index 0000000000..8d33072a55 --- /dev/null +++ b/docs/recent-features/v2.9273.md @@ -0,0 +1,28 @@ +# v2.9273 — Settings: check your connection when the app is slow (2026-12-03) + +A teammate reported the live app as nearly too slow to use, worst on the Bid Board, and the report came with no numbers. The Fix app page measured nothing: it is a static page that clears the cached files. The owner asked for a tool a person can run to measure their own connection. Client only. No migration, no function change, nothing kept, nothing owed on prod. + +## What changed + +- **Check my connection**, in the *Fix app* box at Settings → Advanced ([`ConnectionCheckCard.tsx`](../../src/components/settings/ConnectionCheckCard.tsx)). One press times four things, three tries each, one after another, no try waiting past 10 seconds: + - the site: one small file with an address no cache has seen; + - the API: the auth health address, which reads no table; + - a small read: the person's own `users` row; + - the Bid Board's read: the Bids page's own list read, its rows thrown away. A role that cannot open Bids (`canOpenBids`) is not shown this line. +- **The words** are the kernel [`connectionCheck.ts`](../../src/lib/connectionCheck.ts): a line's time is the middle of its tries (`summarizeTries`), under 1 s reads *fast*, 1 to 3 s *slow*, over 3 s *very slow*, none in 10 s *did not answer* (`speedOf`). One sentence on top (`checkVerdict`) names the person's connection when the site or the API is slow, the app's own reads when both are fast and a read is slow, and says so when everything was fast. +- **Copy the report** puts plain lines on the clipboard (`reportText`): the verdict, the lines, the build, the role, the connection kind where the browser gives one, the hour with its zone and the browser's own name. No name, email, job or figure. Where the clipboard is refused the lines are shown in a box to copy by hand. +- **The timings** are [`connectionCheckIo.ts`](../../src/lib/connectionCheckIo.ts) (`timeTry`, `runConnectionCheck`). They only read. +- The Bids list select moved from `useBidsPageData.ts` to [`lib/bids/bidListSelect.ts`](../../src/lib/bids/bidListSelect.ts), so the check times the very read the board sends and a lower layer reads nothing from a hook. +- The static Fix page (`public/fix-cache.html`) gained one line that points a slow, not stuck, person to the press. Settings search finds *Check my connection*, and `#settings-connection-check` opens the folded Advanced group. + +## Who can press it + +Every role that has Settings → Advanced. Helpers and subcontractors do not (the gate in `Settings.tsx` is unchanged). + +## Guides + +*know what to do when the app is slow* has a new section, **Check your connection**. *fix the app when it won't load* links to it. + +## Tests + +`src/lib/connectionCheck.test.ts` (the speeds, the middle try, the verdict, the report), `src/components/settings/ConnectionCheckCard.render.test.tsx` (the press, the lines, the copy). diff --git a/public/fix-cache.html b/public/fix-cache.html index 24cda0fcd0..0724e25aff 100644 --- a/public/fix-cache.html +++ b/public/fix-cache.html @@ -19,6 +19,7 @@
If the app shows a white screen after an update, this will clear cached files and reset storage so the app can load correctly.
+Is the app slow, not stuck? Sign in, open Settings, then Advanced, and press Check my connection. It times the app from your device.