drewzh
drewzh
IImmich
Created by drewzh on 2/6/2025 in #help-desk-support
Immich not syncing with multiple iOS devices unless in foreground
Thanks. Totally get the direction to use the contrib channel - just adding context to others that may drop by and wonder where this went. Any dev work I’ll continue to post there 👍
38 replies
IImmich
Created by drewzh on 2/6/2025 in #help-desk-support
Immich not syncing with multiple iOS devices unless in foreground
Also, separate to this particular issue of items not being backed up, the UI whilst backing up in the foreground was basically unusable. As soon as I stopped the foreground backup, the UI became responsive again. Now, using a much smaller album, the UI is snappy again (with continuous hiccups.... but still, usable at least). Has the backup routine itself not being ran in a separate thread? Assuming both of those issues are related, maybe there's a locking issue when dealing with large albums, or just a deficiency in the way that large data sets are being processed (buffering/streaming needed?). My swift/flutter skills are very weak though, so whilst I can take a look to see if there are any logic issues or performance issues (25 years as a dev), it might be out of the realm of my expertise/time I can commit. I'll try though at least as it's killing the experience of what would otherwise be perfect.
38 replies
IImmich
Created by drewzh on 2/6/2025 in #help-desk-support
Immich not syncing with multiple iOS devices unless in foreground
So I've narrowed down the issue a little. I noticed that users were getting iOS notifications indicating backup progress - this is something that I'd never seen before (confirming the background tasks weren't even initiating earlier)... until I deselected our main album (70,000+ pictures) and selected a relatively small one with a few thousand photos. Low and behold, the backup notifications are triggering and photos are being backed up. With that said, it appears the background task that's scheduled is too slow... at least that's my theory. My code changes do bring the scheduling code into what seems to be recommended place (AppDelegate) and I'm explicitly cancelling the existing tasks before registering new ones, but whilst this seems more correct, I don't believe it will fix the background task itself. I suspect the issue might be more systemic than that and tied to the invocation time of the task. I haven't yet been able to AB test to see if my changes have made a difference. I suspect that the background task is attempting to do something heavy like enumerate the entire album of photos and this is taking up the precious time window.
38 replies
IImmich
Created by drewzh on 2/6/2025 in #help-desk-support
Immich not syncing with multiple iOS devices unless in foreground
Will do cheers
38 replies
IImmich
Created by drewzh on 2/6/2025 in #help-desk-support
Immich not syncing with multiple iOS devices unless in foreground
🤞
38 replies
IImmich
Created by drewzh on 2/6/2025 in #help-desk-support
Immich not syncing with multiple iOS devices unless in foreground
Whilst I'm not familiar with flutter, I am somewhat familiar with swift and the code was luckily very easy to understand
38 replies
IImmich
Created by drewzh on 2/6/2025 in #help-desk-support
Immich not syncing with multiple iOS devices unless in foreground
I need to get this running in a simulator to actually work out what's going on (i.e, before and after tests) - but I've checked out the repo and found a few improvements already to be done with the way the background tasks are handled. Specifically the registration should happen earlier, any previous tasks should also be cleared before registering new ones and the first run should probably happen sooner than what's been specified. I'll do some testing when I get time and see if my changes improve things
38 replies
IImmich
Created by drewzh on 2/6/2025 in #help-desk-support
Immich not syncing with multiple iOS devices unless in foreground
No problem, I appreciate your help anyway - I'll do some digging through the code when I get a moment
38 replies
IImmich
Created by drewzh on 2/6/2025 in #help-desk-support
Immich not syncing with multiple iOS devices unless in foreground
I only ask because that's the behaviour I'm witnessing (and others have reported also)... but it just seems.... wrong, right?
38 replies
IImmich
Created by drewzh on 2/6/2025 in #help-desk-support
Immich not syncing with multiple iOS devices unless in foreground
Can I just clarify - are you saying that it's entirely possible that even with background syncing enabled - Immich, currently, with the devs understanding of how background tasks work in iOS, may NEVER sync a single photo, ever?
38 replies
IImmich
Created by drewzh on 2/6/2025 in #help-desk-support
Immich not syncing with multiple iOS devices unless in foreground
That's really good to know - I'm not a flutter expert by any means, but I have 20+ years app years app dev experience.... I'll see if I can spot anything amiss with the logic (which whilst I know is stated to not be the issue here... you never know)
38 replies
IImmich
Created by drewzh on 2/6/2025 in #help-desk-support
Immich not syncing with multiple iOS devices unless in foreground
Oh right wow - I didn't see that
38 replies
IImmich
Created by drewzh on 2/6/2025 in #help-desk-support
Immich not syncing with multiple iOS devices unless in foreground
I presume it's closed source and I can't take a stab at it?
38 replies
IImmich
Created by drewzh on 2/6/2025 in #help-desk-support
Immich not syncing with multiple iOS devices unless in foreground
Is it react native/cordova/similar?
38 replies
IImmich
Created by drewzh on 2/6/2025 in #help-desk-support
Immich not syncing with multiple iOS devices unless in foreground
I can work around the bulk upload issue for sure - there's ways in which I export it via privacy.apple.com etc to do that, but even there's not a single photo synced during the background process during the last 48 hours across 2 different users and 3 separate devices... I'm fairly certain I know what the outcome will be once I start to do incremental changes?
38 replies
IImmich
Created by drewzh on 2/6/2025 in #help-desk-support
Immich not syncing with multiple iOS devices unless in foreground
I'm sat on the same network as the Immich server to uploads for super fast (milliseconds per upload rather than seconds) so I'd assume that even if they were uploaded as a whole, the time taken to upload a single image would be minuscule and thus not killed. Playing devils advocate - How sure are we that isn't an overlap of the general consensus that IOS aggressively throttles background tasks VS what might actually be an actual code issue in the iOS app that's just going undiagnosed due to the aforementioned assumption that it's just iOS doing it thing?
38 replies
IImmich
Created by drewzh on 2/6/2025 in #help-desk-support
Immich not syncing with multiple iOS devices unless in foreground
How do other apps seem to get around this? I thought all apps were treated equal? I've tested and not a single photos is backed up over the course of 2 days so far... surely that isn't right? I've brought the app into the foreground a few times between those periods as well to try and 'kick it off again'
38 replies