Repository navigation
fix(telemetry,client): report background sync ping and use dynamic test timestamps - #128
Open
markusbrand wants to merge 1 commit into
Open
markusbrand wants to merge 1 commit into
markusbrand wants to merge 1 commit into
Conversation
…st timestamps - Report client_ping telemetry upon background sync loop completion in client-tauri spawn_background_sync_loop. - Use dynamic UTC timestamps in backend test_telemetry_api_routes to prevent premature retention pruning. - Add OpenSpec change tracking proposal, delta specs, technical design, and verified tasks.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR addresses two concrete bugs identified in BrandyBox's telemetry and testing systems:
Missing client_ping telemetry in desktop client background sync loop:
client-tauri/src-tauri/src/lib.rs,spawn_background_sync_loopexecuted periodic background sync passes but omitted theclient.client_ping(Some(sync_ok), Some(last_sync_at))call present in manual sync (run_sync).GET /api/admin/clientsandbrandybox-doctor --summary).sync_okandlast_sync_atand dispatchingclient.client_pingupon concluding each background sync loop cycle.Backend telemetry test failure due to 30-day retention pruning:
backend/tests/test_telemetry.py,test_telemetry_api_routesused hardcoded static timestamps (2026-09-16T21:00:00Z).prune_telemetry_recordswhich purges records older thannow - 30 days. When executed >30 days after September 16, 2026, the newly ingested summary was immediately pruned on insertion, failingassert any(s["trace_id"] == "sync-api-test-01" for s in summaries).datetime.now(timezone.utc).OpenSpec Change
Tracked under
openspec/changes/fix-background-sync-ping-and-telemetry-test:proposal.mdspecs/central-telemetry/spec.md(added requirements for client ping upon cycle completion)design.mdtasks.mdVerification
cargo test --manifest-path client-tauri/src-tauri/Cargo.toml: 21 passed, 0 failedpytest backend/tests/test_telemetry.py: 2 passed, 0 failedpytest backend: 108 passed, 0 failedpytest tests/e2e/test_run_autonomous_sync.py: 13 passed, 0 failed./scripts/run-qa.sh: full QA passed (client-tauri, web, backend, docs)