Repository navigation
fix(sync): account for modified files in sync total work and fix telemetry test retention date - #122
Open
markusbrand wants to merge 1 commit into
Open
markusbrand wants to merge 1 commit into
markusbrand wants to merge 1 commit into
Conversation
…metry test retention date - Construct download and upload transfer plans before deletion execution in sync.rs. - Calculate total_work accurately as the sum of all planned operations (server deletions, local deletions, downloads, and uploads) rather than using set differences that omit modified existing files. - Log the complete sync plan upfront before starting mutations. - Add regression unit tests verifying total_work includes modified files and calculates accurately in mixed scenarios. - Use dynamic timestamps in backend test_telemetry_api_routes to prevent retention pruning (>30 days) failure. - Add OpenSpec change artifacts for fix-sync-progress-total-work-calculation.
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
Accurate Sync Progress Accounting for Modified Files:
client-tauri/src-tauri/src/sync.rs,total_workwas previously computed using path set differences (current_remote \ current_localandcurrent_local \ current_remote) before planningto_downloadandto_upload.total_workto evaluate to 0 when only existing files were modified (suppressing the progress bar entirely inSettings.tsx), or severely undercounting total work (causingdoneto exceedtotal_work, reporting progress percentages well over 100% likeupload 3 / 1).to_downloadandto_upload) upfront before executing deletions.total_workas(to_del_remote.len() + to_del_local.len() + to_download.len() + to_upload.len()) as u64.sync.rsverifyingtotal_workaccounting with modified files.Telemetry Test Retention Cutoff Time-Bomb Fix:
backend/tests/test_telemetry.py:167,test_telemetry_api_routeshardcoded a fixed date2026-09-16T21:00:00Z.server_events_retention_days = 30, any telemetry summary older than 30 days is automatically purged on ingest byprune_telemetry_records. More than 30 days having elapsed since September 16, 2026 caused the test record to be pruned immediately on ingest, failing subsequent assertions.test_telemetry_api_routesto use dynamic timestamps relative tonow.OpenSpec Change Tracking:
fix-sync-progress-total-work-calculationincluding proposal, delta spec fordesktop-client, design doc, and completed tasks.Verification
cd client-tauri/src-tauri && cargo test-> 23 passed, 0 failed.cd web && npm run build-> successful production build..venv/bin/python -m pytest backend -q-> 108 passed, 0 failed../scripts/run-qa.sh-> all QA checks passed cleanly.