Skip to content

feat(debug): comprehensive integration & debugging workflows (#104) - #3

Open
dorisadams wants to merge 2 commits into
mainfrom
feat/debug-workflows-104
Open

feat(debug): comprehensive integration & debugging workflows (#104)#3
dorisadams wants to merge 2 commits into
mainfrom
feat/debug-workflows-104

Conversation

@dorisadams

Copy link
Copy Markdown
Owner

Closes Stellar-Insightss#104 — dev-gated /debug/* router + DiagnosticSnapshot (backend), debug.ts (frontend), debugService.ts (mobile), scripts/debug-stack.sh, docs/debugging-guide.md.

…#127)

Flips `unwrap_used`, `expect_used`, `panic` from `allow` to `warn` in `backend/Cargo.toml` and tightens `.github/workflows/clippy.yml` + `ci-quality.yml` so `cargo clippy --lib` denies them. The three non-test `.expect()` calls in `backend/src/rpc/stellar.rs` are replaced with safe `match`+`warn` fallbacks / typed errors.

No scaffolding for Stellar-Insightss#93 or Stellar-Insightss#104 in this PR — those PRs register their own modules. This keeps the lint fix scope minimal and conflict-free.

Refs Stellar-Insightss#127
…-Insightss#104)

Dev-gated diagnostic toolkit. The debug surface is double-gated by `STELLAR_INSIGHTS_DEBUG=1` AND `cfg(debug_assertions)` (or `RUST_ENV=development`), so production bundles never expose diagnostic data.

* `backend/src/debugging/{mod,state}.rs` — dev-only `/debug/*` router (`/debug/health/detail`, `/debug/cache/state`, `/debug/queue/status`) returning `503` in production. `DiagnosticSnapshot` exposes counts only — never secrets. 5 unit tests. The `ENV_LOCK` static mutex in `state.rs` has an explicit `do NOT hold across .await` comment.
* `frontend/src/lib/debug.ts` — dev-only `getDebugSnapshot` / `subscribeDebug`. Connectivity, realtime (WebSocket) health, TanStack Query cache counts, localStorage size estimate. Gated to `process.env.NODE_ENV !== "production"`.
* `mobile/src/services/debugService.ts` — dev-only `getMobileDebugSnapshot` (connectivity, sync_queue depth, notification permission). Gated to `__DEV__`.
* `docs/debugging-guide.md` — comprehensive developer reference covering backend / frontend / mobile / WebSocket workflows, common failure scenarios, production-safety checks.
* `scripts/debug-stack.sh` — boots the backend in debug mode and prints diagnostic URLs the README can point contributors at.
* `backend/src/lib.rs` — registers the new `debugging` module.

Refs Stellar-Insightss#104
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.

📚 [Docs] Comprehensive Integration & Debugging Workflows

1 participant