Skip to content

Background sync not working in terminated state & battery saver mode (Workmanager) #644

@Muneeza-PT

Description

@Muneeza-PT

I am building an attendance app in Flutter where:
When a user marks attendance, the record is saved locally (Isar).
A cron job (every 15 sec) pushes local data to the server.
If the app is alive (foreground or background), this sync works fine.

Problem:
If the app is terminated or device is in battery saver / Doze mode, WorkManager does not run reliably. The server never gets the new attendance until the app is opened again.

What I need (real-world scenario like WhatsApp)
I want guaranteed sync even if:
App is terminated / killed by user
Device is in Doze mode / Battery saver
Server was temporarily down (app should retry later)

Attempts so far
✅ Used workmanager → works in background, but unreliable in terminated + battery saver mode.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions