Skip to content

[MS-1541] Stop event sync retries on network connection failure - #1782

Draft
meladRaouf wants to merge 6 commits into
feature/MS-1538-sync-worker-errorsfrom
bugfix/extra-events-offline
Draft

[MS-1541] Stop event sync retries on network connection failure#1782
meladRaouf wants to merge 6 commits into
feature/MS-1538-sync-worker-errorsfrom
bugfix/extra-events-offline

Conversation

@meladRaouf

@meladRaouf meladRaouf commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

MS-1541
Will be released in: 2026.3.0

Root cause analysis (for bugfixes only)

First known affected version: 2026.3.0

  • When the device is offline, EventUpSyncTask.uploadEventScopeType retries uploading closed event scopes in a while loop with no delay/backoff.
  • Each failed upload attempt calls authStore.getFirebaseToken() under the hood, which throws NetworkConnectionException when FirebaseAuthManager can't reach the network. This is caught and unconditionally logs a new EventUpSyncRequestEvent, unlike the success path which only logs when there's useful content.
  • Because the failed scope is never deleted, the loop's exit condition (getClosedEventScopesCount(...) > 0) stays true, so it retries immediately with no backoff — spinning indefinitely while offline and creating a new event on every iteration, which shows up as accumulating extra events on the dashboard sync screen.

Changes

  • EventUpSyncTask.uploadEventScopeType: when the upload fails with a NetworkConnectionException, break out of the retry loop for that scope type instead of retrying immediately, deferring the retry to the next scheduled sync attempt. This limits the failure to a single logged event per sync run while offline instead of an unbounded tight loop.

Testing guidance

  • To verify manually: put the device in airplane mode with pending events to sync, trigger a sync, and confirm the sync screen event count stops growing after a single failed attempt instead of climbing continuously.

Additional work checklist

  • Effect on other features and security has been considered
  • Design document marked as "In development" (if applicable)
  • External (Gitbook) and internal (Confluence) Documentation is up to date (or ticket created)
  • Test cases in Testiny are up to date (or ticket created)
  • Other teams notified about the changes (if applicable)

@cla-bot cla-bot Bot added the ... label Aug 12, 2026
@luhmirin-s

Copy link
Copy Markdown
Contributor

@meladRaouf can you please stack this on top of #1783? There was a significant rework and it might need slightly different approach.

@meladRaouf
meladRaouf changed the base branch from main to feature/MS-1538-sync-worker-errors August 12, 2026 14:27
@luhmirin-s
luhmirin-s force-pushed the bugfix/extra-events-offline branch from b8599d6 to 49f3139 Compare August 13, 2026 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants