Skip to content

Add on-device app log for failed saves, images, and summaries - #70

Merged
jonocodes merged 1 commit into
mainfrom
feature/app-failure-log
Sep 20, 2026
Merged

jonocodes merged 1 commit into
mainfrom
feature/app-failure-log

Conversation

@jonocodes

Copy link
Copy Markdown
Owner

Why

Failures were only visible in the JavaScript console plus a transient snackbar. On mobile there's no console, so a failed save, a broken image/thumbnail download, or a failed summary left no trace.

What

Adds an app-level event log persisted in IndexedDB and surfaced on the Diagnostics screen.

  • Storage: new logs Dexie table (schema v5) and src/utils/logging.ts (recordLog, clearLogs, formatLogsForCopy). Bounded to the last 500 entries; logging is fire-and-forget and never throws.
  • Instrumented failures:
    • Article fetch/download and processing failures, including the no-slug case where a per-article fetch.log can't exist (lib/src/ingestion.ts)
    • Image/thumbnail download failures during ingestion (lib/src/ingestion.ts)
    • Summarization failures, both during ingest and manual re-summarize (lib/src/ingestion.ts, ArticleScreen.tsx)
    • Thumbnail loads (tools.ts) and PDF/image/paste ingest errors (SubmitScreen.tsx)
  • UI: new "App Log" panel on /diagnostics (Preferences → Diagnostics) with level/category filters and a copy-to-clipboard button so the log can be pasted off a phone. Local only — nothing is uploaded or synced.

Notes

The existing per-article saves/<slug>/fetch.log is untouched and still shown in the article's Edit Info drawer; this is a separate, app-wide log.

Testing

  • npx tsc --noEmit — clean
  • npm run lint — no new warnings
  • npx jest — 281 passed

Docs updated: README FAQ entry and CHANGELOG.

Record article-download, image/thumbnail, and summarization failures in a
bounded IndexedDB log, surfaced on the Diagnostics screen with filtering
and copy-to-clipboard. This makes failures inspectable from mobile, where
the JS console is not available.
@jonocodes
jonocodes merged commit 9a0bbd8 into main Sep 20, 2026
2 checks passed
@jonocodes

Copy link
Copy Markdown
Owner Author

Follow-up (6cf4f5f): testing the 429 from the CORS proxy surfaced a gap. A cross-origin response without CORS headers makes fetch reject with a bare TypeError and hides the HTTP status from JS (confirmed: PerformanceResourceTiming.responseStatus is 0 on CORS failure).

Failed downloads now log:

  • requestUrl — the resolved URL including the CORS proxy, so you can open it directly and see the status
  • status — when the browser exposes it
  • proxyUsed / proxyReachable — when the status is hidden, a no-cors probe distinguishes 'proxy answered but browser blocked the response' from 'proxy unreachable'
  • hint — points at the likely cause (e.g. 429 rate limiting / missing CORS headers)

Image-download failures also carry requestUrl/status now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant