Skip to content

Move showProgressNotification() to be the first thing in Workers' doW…#1368

Merged
BurningAXE merged 1 commit into
release/2025.3.0from
bugfix/foreground-service-timeout-crash
Sep 23, 2025
Merged

Move showProgressNotification() to be the first thing in Workers' doW…#1368
BurningAXE merged 1 commit into
release/2025.3.0from
bugfix/foreground-service-timeout-crash

Conversation

@BurningAXE
Copy link
Copy Markdown
Contributor

@BurningAXE BurningAXE commented Sep 18, 2025

JIRA ticket
Will be released in: 2025.3.0

Root cause analysis (for bugfixes only)

First known affected version: 2025.3.0-dev

  • In all workers the first thing we do is logCrashlytics() and then we call showProgressNotification()
  • logCrashlytics() is a little misleading because apart from logging in Crashlytics, it saves logs in a local file. This can be time consuming
  • In rare cases when device's CPU is overwhelmed this can delay the call to showProgressNotification() (and consequently the required startForeground()) beyond the timeout that triggers a ForegroundServiceDidNotStartInTimeException()

Notable changes

  • swaps the order so that showProgressNotification() is the first thing that each Worker does in its doWork()

Testing guidance

  • Open sync screen and tap sync buttons on events and images like crazy for a minute or two - if no crash - celebrate!

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 Sep 18, 2025
@BurningAXE BurningAXE requested a review from Copilot September 18, 2025 17:26
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR moves the showProgressNotification() call to be the first statement in each Worker's doWork() method, appearing before crashlyticsLog("Started"), to prevent timeout crashes.

  • Reorders initialization sequence in worker classes to show progress notification first
  • Ensures progress notification displays immediately when workers start
  • Addresses a specific timeout crash issue by prioritizing user-visible feedback

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
ProjectConfigDownSyncWorker.kt Moves showProgressNotification() before crashlyticsLog()
DeviceConfigDownSyncWorker.kt Moves showProgressNotification() before crashlyticsLog()
EventUpSyncUploaderWorker.kt Moves showProgressNotification() before crashlyticsLog()
EventSyncMasterWorker.kt Moves showProgressNotification() before crashlyticsLog()
EventStartSyncReporterWorker.kt Moves showProgressNotification() before crashlyticsLog()
EventEndSyncReporterWorker.kt Moves showProgressNotification() before crashlyticsLog()
BaseEventDownSyncDownloaderWorker.kt Moves showProgressNotification() before crashlyticsLog()
RealmToRoomMigrationWorker.kt Reorders multiple initialization calls including showProgressNotification()
StoreUserLocationIntoCurrentSessionWorker.kt Moves showProgressNotification() before crashlyticsLog()

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@BurningAXE BurningAXE force-pushed the bugfix/foreground-service-timeout-crash branch from 4157c78 to ae571b8 Compare September 18, 2025 17:33
@BurningAXE BurningAXE marked this pull request as ready for review September 23, 2025 15:22
@BurningAXE BurningAXE requested review from a team, TristramN, alex-vt, alexandr-simprints, luhmirin-s, meladRaouf and ybourgery and removed request for a team September 23, 2025 15:23
@BurningAXE BurningAXE force-pushed the bugfix/foreground-service-timeout-crash branch from ae571b8 to 062a1f5 Compare September 23, 2025 16:23
@sonarqubecloud
Copy link
Copy Markdown

@BurningAXE BurningAXE merged commit 76e40cd into release/2025.3.0 Sep 23, 2025
13 checks passed
@luhmirin-s luhmirin-s deleted the bugfix/foreground-service-timeout-crash branch September 24, 2025 06:08
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.

3 participants