Repository navigation
fix(client): record sync summary and flush telemetry on delete failure - #126
Open
markusbrand wants to merge 1 commit into
Open
markusbrand wants to merge 1 commit into
markusbrand wants to merge 1 commit into
Conversation
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
When the desktop client synchronization engine encountered an error while deleting a remote file on the server (e.g., HTTP 403, 500, or network disconnect), it queued a
DiagnosticEventPayloadand terminatedrun_syncwithreturn Err(...). However, unlike thelist_filesfailure path or the normal completion path, it omittedenqueue_sync_summaryandflush_telemetry_queue(client).Consequently:
SyncSummaryrecord was ever generated or persisted for the failed sync cycle.DiagnosticEventremained stuck in the local offline file buffer and was never flushed.brandybox doctorremained completely unaware of sync failures occurring during remote file deletion.Changes
client-tauri/src-tauri/src/sync.rs, whenclient.delete_file(path)fails:SyncSummaryPayloadwithstatus: "failed",failure_count: 1, elapsedduration_ms, total scanned file count (local_list.len() + remote_list.len()), and error details inerror_summary_json.flush_telemetry_queue(client)before returning the error.client-tauri/src-tauri/src/config.rsandcredentials.rs, export and use a sharedENV_MUTEXfor unit tests to ensure thread-safe environment variable isolation during parallel test execution.test_sync_delete_failure_records_summary_and_flushes_telemetryinclient-tauri/src-tauri/src/sync.rsto reproduce and verify the fix.openspec/changes/fix-sync-delete-failure-telemetry-summary/.Verification
Expected 1 SyncSummaryPayload enqueued on delete failure (left: 0, right: 1).cargo testpasses all 22 tests.npm run buildinweb) and docs build (mkdocs build) succeed.