Use this doc when you are diagnosing behavior in the running CLI.
The main idea is simple: use repeatable, task-driven workflows in safe environments first, then narrow scope with logs and targeted traces.
Debug workflows default to dev in taskfiles/debug.yml.
That is intentional. Iterative debugging in prd should be rare and explicit.
The debug taskfile includes a guard that blocks accidental prd use unless
ALLOW_PRD=1 is set. Keep that safeguard.
When something “feels broken” in the UI, start here:
- Run through the debug task entrypoints.
- Tail slow-loop logs and feature-specific traces.
- Reproduce once with minimal noise.
- Correlate logs with expected state transitions.
- Turn findings into a test or a targeted fix.
The important part is reproducibility. Manual ad hoc commands tend to drift and make incident analysis harder to compare across engineers.
task debug:list
task debug:ui:run
task debug:ui:logs:slow
task debug:onboarding:trace
task debug:sync:trace
task debug:sync:health
task debug:data:snapshotThese commands are designed to align with the architecture: UI loop behavior, onboarding transitions, sync/upload health, and local DB state.
Use task debug:ui:logs:slow while reproducing.
The app emits slow app update and slow app render telemetry with fields
like duration_ms, msg_type, overlay state, and drawer context.
That gives you immediate signal on whether the event loop is blocked in update, render, or a specific interaction mode.
Use task debug:onboarding:trace.
Correlate gate enter/exit logs (including trigger and duration) with what the
user reports seeing. This tells you whether the issue is true stalling, rapid
gate transitions, or missing visibility/status feedback.
Use task debug:sync:trace and task debug:sync:health.
These views combine syncer and uploader signals so you can distinguish
connectivity/retry behavior from queue stalls and normal post-failure
convergence.
For deeper PowerSync analysis, capture and sanitize fixtures:
- Capture stream data.
- Sanitize it to a commit-safe fixture.
- Replay it with correctness tests.
Keep raw production captures out of commits; only sanitized fixtures should be checked in.