Skip to content

Android: "Last sync" time can appear to be in future, e.g. "Last sync: in 6 min" #2150

@rmunn

Description

@rmunn

Describe the bug
Related to #2149. If you have had the Synchronize dialog open in the Android app (v2025-12-03-9cc9b680) for some time, like 5 or 6 minutes, and then you tap the "Auto syncing" button to actually launch a sync, then after the sync completes the "Last sync" value can show a date in the future, such as "in 6 min".

The reason for this is apparently that the dialog grabs the value of "now" when it opens, and is still using that value of "now" for calculating relative dates when the sync happens. So if the dialog was opened at 12:45 PM, then the sync button was pressed at 12:51 PM, it stores 12:51 as the time of last sync, subtracts "now" from 12:51 to get a relative time of -6 minutes (i.e. negative 6 minutes in the past, or 6 minutes in the future) and says that the last sync happened "in 6 min".

To Reproduce
Steps to reproduce the behavior:

  1. Open FW Lite Android app
  2. Make a change in another FW Lite copy so there's something to sync
  3. Click on Synchronize menu item
  4. Leave dialog open for two minutes
  5. Click on "Auto syncing" button to perform a sync
  6. Note the relative time for "Last sync" is in the future by the same amount of time you waited in step 4

Expected behavior
The value of "now" used by "Last sync" would be live, or if that's too expensive then at least would be updated when the sync button is pressed (and then every 10-15 seconds after that so that the value becomes "10 seconds ago", "20 seconds ago", etc., until the dialog is closed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions