Open Bug 1264279 Opened 8 years ago Updated 2 years ago

Sync is not performed when device auto locks

Categories

(Firefox for iOS :: Sync, defect, P3)

All
iOS
defect

Tracking

()

UNCONFIRMED
Tracking Status
fxios-v4.0 --- affected
fxios + ---

People

(Reporter: SimonB, Unassigned)

References

Details

Build: 4.0.0b1

Steps to reproduce:
1. Launch Firefox
2. Login with account 
3. Open settings menu
4. Wait for device to auto-lock
5. Unlock device 

Actual results:
- The sync is not performed while the application is running in background

Expected results:
- The sync is not performed while the application is running in background (the time of the last sync does not change)

Note:
- When locking the device by pressing the lock button, sync is performed
- When minimizing application by pressing the home button, sync is performed
The Expected/Actual results above are incorrect. Here are the correct ones.

Actual results: 
- The sync is not performed while the application is running in background (the time of the last sync does not change)

Expected:
- Sync is performed on the background
Does it really not sync, or does it not update the UI? (Enter and leave settings very quickly to check this)

Does a timed sync occur if you wait 15 minutes while the device is locked?

Our only expectation here is that we sync when you exit the application -- that is, when you hit the home button -- so I think this bug is INVALID. We don't expect a sync to occur when the device locks automatically.
Flags: needinfo?(jhugman)
The reason this issue was logged is that different behavior was observed while locking device using auto lock and using device lock button:
- when using the lock button, it was observed that sync is performed almost instantly after device was unlocked
- when the device auto locks, it was observed that after unlocking,sync is performed after a longer period of time.(this is probably a scheduled sync and not a “sync on exit”)
As it stands, syncEverything() runs on applicationDidEnterBackground as per https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html#//apple_ref/doc/uid/TP40007072-CH4-SW1

As such, the app will sync when the home button is pressed and when the device auto-locks.

The update to the lastSyncFinishTime happens when the last sync job is finished.

You can see the exact time stamp in the logs on the message: 

> Ending all queued syncs.

The only time this will fail is when sync takes longer than 10 minutes allowed by iOS.

In that case, the expiration handler is run without the lastSyncFinishTime to be updated.

I wouldn't expect the sync to start spontaneously after being in the background for 15 minutes.

If anything, I would expect the lastSyncFinishTime to be inaccurate due to be a record of the last attempted sync that finished (successful or unsuccessful), i.e. overly frequent, rather than under frequent as this bug would suggest.

Is your sync job especially long? Are these STR reliable?
Status: NEW → UNCONFIRMED
Ever confirmed: false
Flags: needinfo?(jhugman) → needinfo?(simion.basca)
Comparing the results using the same function(lock device) but through different methods should have the same behavior. It was noticed that this is not the case. 

While using the lock button to lock device, it can be observed that the Feature "Sync on exit" is functional (the sync is done within second after lock - this can be seen in the in the sync time in settings). 

While the device auto-locks using auto-lock iOS function, it was noticed that sync is not performed upon exit but rather when returning to the application( this also can be seen in settings in the last sync time). The sync will be performed after ~ 2 minutes when returning to the application.
Flags: needinfo?(simion.basca)
Rank: 3
Priority: -- → P3
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.