Skip to content

fix(sync-report): the last background sync reports how it ended - #1644

Closed
juanky201271 wants to merge 1 commit into
devfrom
fix/sync-report-background-state
Closed

juanky201271 wants to merge 1 commit into
devfrom
fix/sync-report-background-state

Conversation

@juanky201271

Copy link
Copy Markdown
Contributor

Problem

The last-background-sync card on the sync report took its state from the error field alone. Anything without one showed a green check and Finished OK, including:

  • a task the system killed before it wrote its end time (dateEnd = 0, message "Starting OK.")
  • a task cancelled because the app was in the foreground, or with no wallet (message ends in "KO.", no error)
  • a sync skipped in offline mode

Tapping View/Report Error also cleared the error and rewrote background.json, so the card flipped to green after one report.

Change

  • backgroundOutcome in syncModel.ts derives one of ok | skipped | failed | interrupted from the file the native task writes: failed on an error or a message ending in "KO.", interrupted when there is no end time, skipped on the offline message, ok otherwise.
  • The card shows icon, colour and label per outcome. Red with View/Report Error and a tappable row only when there is error text; amber Did not finish; grey Skipped, offline; green Finished OK.
  • Reporting an error no longer clears it. setBackgroundSyncErrorInfo and BackgroundFileImpl.writeBackground had no other caller and are removed; only the native task writes the file now.
  • Three new sync.* keys in the five languages.

Tests

Five unit cases on backgroundOutcome, one per outcome plus the KO-without-error one. The screen snapshot is unchanged.

🤖 Generated with Claude Code

The card took its state from the error field alone, so a sync the system
killed, one cancelled by the app in the foreground, one skipped offline
and one that failed without error text all showed a green Finished OK.
The outcome now comes from the file the native task writes: failed on an
error or a KO message, interrupted without an end time, skipped on the
offline message, ok otherwise. Reporting an error no longer clears it,
so the user can report it again; the setter and the file writer that
served that are gone.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@juanky201271

Copy link
Copy Markdown
Contributor Author

Moved into #1643.

@juanky201271
juanky201271 deleted the fix/sync-report-background-state branch October 15, 2026 16:42
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.

1 participant