crspybits / SharedImages

Neebla on the Apple App Store: Private and Self-Owned Social Media: This is *deprecated*: see http://github.com/SyncServerII/Neebla.git
https://crspybits.github.io/SyncServerII/
MIT License
12 stars 9 forks source link

Problems with sync or sticky sign in? #139

Closed crspybits closed 5 years ago

crspybits commented 6 years ago

I just accepted a sharing invite from Bushrod, and on a refresh on the albums screen, I didn't see the new album. Had to restart the app. Possible sticky sign in issue?

This kind of thing seems to be happening a lot for me lately. I try to refresh, but see no sign of activity. No positive result, and no indication of a lack of download available (on a specific album screen).

I need some way to diagnose/debug this. Perhaps some new alerts for just my build?

Also-- not sure if this is the same thing, When there is a Cloud Download icon in the upper right, often I can't clear it by downloading in the album. Or maybe the sync is just taking a while? They cleared now.

crspybits commented 5 years ago

What I have learned so far:

1) The flag syncOperating is true, but no sync is actually operating. So, a delayed sync gets queued but never actually happens. It seems clear this bug is thus not a problem with sticky signin per se but rather a problem with the sync mechanism. A consequence of this mechanism of bug operation is that restarting the app will clear the problem.

2) The issue seems to take some period of inactivity of the app to exhibit itself. It may be that the app has to be in the background, and come back into the foreground, to show itself. Though I believe I recently saw a case where: (a) app was in foreground and I successfully did a refresh, and then (b) a short period of time later, with the app still in the foreground, the issue came up.

crspybits commented 5 years ago

Hypothesis:

1) A background Index endpoint request occurs to update the app badge. 2) That request takes a long time (it will time out eventually), for some reason. (I've just seen evidence in the log files that a timeout can take as long as seven minutes). 3) While that request is operating, the app is brought into the foreground and a refresh operation is carried out. 4) The timed out Index request doesn't call the appropriate callback and thus doesn't reset the syncOperating flag due to some (related?) bug.

If this hypothesis is true, then stopping the app from doing the (background?) badge refresh should stop this bug from happening.

crspybits commented 5 years ago

The cause of this seems to have been triggering a network request in the AppDelegate in applicationWillResignActive.

crspybits commented 5 years ago

Calling this done for now. More extended testing and use of the app will indicate if this is cured.