[BUG] Background service not respecting WiFi only setting #770

Closed
opened 2026-02-04 22:25:05 +03:00 by OVERLORD · 20 comments
Owner

Originally created by @EnochPrime on GitHub (Mar 24, 2023).

Originally assigned to: @fyfrey on GitHub.

The bug

The background service can still use mobile data despite being configured for WiFi only. I started with a fresh setup and choose the desired album. Then while home started the backup. After leaving the WiFi network I realized mobile data was being used.

Screenshot_2023-03-24-12-46-28-28_d8aea95ef633eb6b7eb1cae13c34b40e

Screenshot_2023-03-24-12-46-45-38_f477f0d1f9efd6499236910aab472e51

The OS that Immich Server is running on

Various

Version of Immich Server

v1.51.2

Version of Immich Mobile App

v1.51.0

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

N/A

Your .env content

N/A

Reproduction steps

1. Open backup settings and ensure background WiFi is enabled.
2. Press start backup button while on WiFi
3. Leave WiFi network

Additional information

No response

Originally created by @EnochPrime on GitHub (Mar 24, 2023). Originally assigned to: @fyfrey on GitHub. ### The bug The background service can still use mobile data despite being configured for WiFi only. I started with a fresh setup and choose the desired album. Then while home started the backup. After leaving the WiFi network I realized mobile data was being used. ![Screenshot_2023-03-24-12-46-28-28_d8aea95ef633eb6b7eb1cae13c34b40e](https://user-images.githubusercontent.com/1175190/227590776-2a0ddf96-524b-431c-938f-56c795998df7.jpg) ![Screenshot_2023-03-24-12-46-45-38_f477f0d1f9efd6499236910aab472e51](https://user-images.githubusercontent.com/1175190/227590801-959b96c9-e23d-4576-957d-4cd9c466fe5f.jpg) ### The OS that Immich Server is running on Various ### Version of Immich Server v1.51.2 ### Version of Immich Mobile App v1.51.0 ### Platform with the issue - [ ] Server - [ ] Web - [X] Mobile ### Your docker-compose.yml content ```YAML N/A ``` ### Your .env content ```Shell N/A ``` ### Reproduction steps ```bash 1. Open backup settings and ensure background WiFi is enabled. 2. Press start backup button while on WiFi 3. Leave WiFi network ``` ### Additional information _No response_
OVERLORD added the 📱mobile label 2026-02-04 22:25:05 +03:00
Author
Owner

@bo0tzz commented on GitHub (Mar 24, 2023):

The WiFi setting only applies to the background backup.

@bo0tzz commented on GitHub (Mar 24, 2023): The WiFi setting only applies to the background backup.
Author
Owner

@EnochPrime commented on GitHub (Mar 24, 2023):

The WiFi setting only applies to the background backup.

Was I not backing up in the background? There is significant data usage from the background.

@EnochPrime commented on GitHub (Mar 24, 2023): > The WiFi setting only applies to the background backup. Was I not backing up in the background? There is significant data usage from the background.
Author
Owner

@jrasm91 commented on GitHub (Mar 24, 2023):

I think the issue was changing networks after the backup had started. Maybe it's worth verifying where the network check is actually used as it could only be checked at the beginning, not before each upload.

@jrasm91 commented on GitHub (Mar 24, 2023): I think the issue was changing networks after the backup had started. Maybe it's worth verifying where the network check is actually used as it could only be checked at the beginning, not before each upload.
Author
Owner

@fyfrey commented on GitHub (Mar 25, 2023):

On Android, this setting is managed by the system. The system scheduler automatically stops the task if connection to wifi is lost. However, the upload currently in progress might have a few seconds where it continues upload an asset.

You also have the foreground backup enabled (which is not affected by the setting) and on the screenshot it currently shows uploading a video file while not being on wifi. I'm not sure how Android counts the data usage of foreground and background but maybe it's not directly translatable to our foreground/background backup. I'd suggest you disable automatic foreground backup and see whether your phone still uploads images without wifi.

@fyfrey commented on GitHub (Mar 25, 2023): On Android, this setting is managed by the system. The system scheduler automatically stops the task if connection to wifi is lost. However, the upload currently in progress might have a few seconds where it continues upload an asset. You also have the foreground backup enabled (which is not affected by the setting) and on the screenshot it currently shows uploading a video file while not being on wifi. I'm not sure how Android counts the data usage of foreground and background but maybe it's not directly translatable to our foreground/background backup. I'd suggest you disable automatic foreground backup and see whether your phone still uploads images without wifi.
Author
Owner

@bo0tzz commented on GitHub (Mar 28, 2023):

I've just (inadvertently) reproduced this on an Android phone. At the time where this happened, I'd been off wifi for at least 6 hours and the uploading video was one I'd just taken. See https://photos.bo0tzz.me/share/48d7c8ebc3e511e589096d78224fd261ebc97072bd9a9d23281bce0eae13fa7ef2fadbfaac7291c3734869aee36710ff4e01 for screenshots.

@bo0tzz commented on GitHub (Mar 28, 2023): I've just (inadvertently) reproduced this on an Android phone. At the time where this happened, I'd been off wifi for at least 6 hours and the uploading video was one I'd just taken. See https://photos.bo0tzz.me/share/48d7c8ebc3e511e589096d78224fd261ebc97072bd9a9d23281bce0eae13fa7ef2fadbfaac7291c3734869aee36710ff4e01 for screenshots.
Author
Owner

@fyfrey commented on GitHub (Mar 29, 2023):

I'll take a look whether we can read out the currently configured background task settings from Android system within the app. Otherwise, it'll be very challenging to further debug this.

@fyfrey commented on GitHub (Mar 29, 2023): I'll take a look whether we can read out the currently configured background task settings from Android system within the app. Otherwise, it'll be very challenging to further debug this.
Author
Owner

@fyfrey commented on GitHub (May 12, 2023):

There is actually no setting for "only on wifi" for Android, there is only metered and unmetered connections (typically wifi). However, you can set your mobile data connection as unmetered in the Android system settings. If set, Immich would also upload if not connected to wifi

@fyfrey commented on GitHub (May 12, 2023): There is actually no setting for "only on wifi" for Android, there is only metered and unmetered connections (typically wifi). However, you can set your mobile data connection as unmetered in the Android system settings. If set, Immich would also upload if not connected to wifi
Author
Owner

@gmag11 commented on GitHub (Aug 6, 2023):

Hi. Same happens here. During my holidays trip I wasn't connected to any wifi, but all my pictures were uploaded just after taking them.

A possible workaround may be restricting mobile data for Immich in Android settings.

Screenshot_2023-08-05-23-24-36-174_com.miui.securitycenter-edit.jpg

Screenshot_2023-08-05-23-25-03-419_com.miui.securitycenter-edit.jpg

@gmag11 commented on GitHub (Aug 6, 2023): Hi. Same happens here. During my holidays trip I wasn't connected to any wifi, but all my pictures were uploaded just after taking them. A possible workaround may be restricting mobile data for Immich in Android settings. ![Screenshot_2023-08-05-23-24-36-174_com.miui.securitycenter-edit.jpg](https://github.com/immich-app/immich/assets/6190183/035525a2-889a-43d8-a6eb-404b65a02ff0) ![Screenshot_2023-08-05-23-25-03-419_com.miui.securitycenter-edit.jpg](https://github.com/immich-app/immich/assets/6190183/0090c41e-d479-4615-94d4-31c1b38fd332)
Author
Owner

@titro commented on GitHub (Oct 29, 2023):

would be great having this issue solved together with a option to restrict Wifi sync only to specific WIFI SSIDs. The background sync service is going crazy when connected with a not at home WIFI and the app then tries to connect to the immich server (which is not reachable) and tries to sync.

@titro commented on GitHub (Oct 29, 2023): would be great having this issue solved together with a option to restrict Wifi sync only to specific WIFI SSIDs. The background sync service is going crazy when connected with a not at home WIFI and the app then tries to connect to the immich server (which is not reachable) and tries to sync.
Author
Owner

@sidamos commented on GitHub (May 24, 2024):

Same happens on iOS with the latest app version 1.105.1. I have enabled background sync on WiFi only and still it uploads new photos when I am not on WiFi.

Edit: I had a quick look at the code (no iOS expert) and it looks like the background sync does respect the setting "require_wifi", but it does not get its current value from the caller. It does get "require charging" and "require unmetered network" (which cannot even be configured in the iOS UI).

In BackgroundServicePlugin.swift:

    // Parse the arguments from the method call
    let requireUnmeteredNetwork = args[0] as? Bool
    let requireCharging = args[1] as? Bool
    let triggerUpdateDelay = args[2] as? Int
    let triggerMaxDelay = args[3] as? Int
@sidamos commented on GitHub (May 24, 2024): Same happens on iOS with the latest app version 1.105.1. I have enabled background sync on WiFi only and still it uploads new photos when I am not on WiFi. Edit: I had a quick look at the code (no iOS expert) and it looks like the background sync does respect the setting "require_wifi", but it does not get its current value from the caller. It does get "require charging" and "require unmetered network" (which cannot even be configured in the iOS UI). In BackgroundServicePlugin.swift: > // Parse the arguments from the method call > let requireUnmeteredNetwork = args[0] as? Bool > let requireCharging = args[1] as? Bool > let triggerUpdateDelay = args[2] as? Int > let triggerMaxDelay = args[3] as? Int
Author
Owner

@interunivers commented on GitHub (Sep 17, 2024):

Still happening regularly in the ios app (app version 1.115)

@interunivers commented on GitHub (Sep 17, 2024): Still happening regularly in the ios app (app version 1.115)
Author
Owner

@schuettecarsten commented on GitHub (Mar 24, 2025):

This issue is still there and might cause significant costs for mobile users.
It should be fixed as soon as possible!

@schuettecarsten commented on GitHub (Mar 24, 2025): This issue is still there and might cause significant costs for mobile users. It should be fixed as soon as possible!
Author
Owner

@AllexisO commented on GitHub (Apr 22, 2025):

Agree that this issue is still there!
Images are uploading immediately when you open Immich app and using mobile data internet.
There should be an option to upload images only with WiFi (not only Automatic background backup, but always upload images with Wifi when you open application).
The issuw is reproducable with Android (Samsung S21 Ultra Android 14).

@AllexisO commented on GitHub (Apr 22, 2025): Agree that this issue is still there! Images are uploading immediately when you open Immich app and using mobile data internet. There should be an option to upload images only with WiFi (not only Automatic background backup, but always upload images with Wifi when you open application). The issuw is reproducable with Android (Samsung S21 Ultra Android 14).
Author
Owner

@Jabberworkkkk commented on GitHub (Jun 25, 2025):

I am using an iPhone with IOS 18.5, with Immich App 1.135.3, can confirm the issue is still there.

@Jabberworkkkk commented on GitHub (Jun 25, 2025): I am using an iPhone with IOS 18.5, with Immich App 1.135.3, can confirm the issue is still there.
Author
Owner

@shenlong-tanwen commented on GitHub (Sep 13, 2025):

For those of you facing the issue, Can you try the new beta timeline and see if you still face accidental uploads outside the desired network configuration?

@shenlong-tanwen commented on GitHub (Sep 13, 2025): For those of you facing the issue, Can you try the new beta timeline and see if you still face accidental uploads outside the desired network configuration?
Author
Owner

@EnochPrime commented on GitHub (Sep 13, 2025):

I turned off WiFi, took a picture, and monitored immich for a couple minutes. It did not upload the picture until I turned WiFi back on. So it appears the new system solves this bug.

The notification(s) that assets were being uploaded did appear and remained until I turned WiFi back on and it could complete. So a potential improvement could be to check if the upload can happen before generating the notification.

@EnochPrime commented on GitHub (Sep 13, 2025): I turned off WiFi, took a picture, and monitored immich for a couple minutes. It did not upload the picture until I turned WiFi back on. So it appears the new system solves this bug. The notification(s) that assets were being uploaded did appear and remained until I turned WiFi back on and it could complete. So a potential improvement could be to check if the upload can happen before generating the notification.
Author
Owner

@Fricsion commented on GitHub (Sep 14, 2025):

I am sorry I'm commenting on an issue closed yesterday (cheers to the devs)

But just today, I caught Immich iOS app uploading video when it's on cellular.
I am on the latest app (1.142.0 build 223) and beta timeline is enabled.

It used like 500+ MB of data and I was able to catch it doing because the phone was very hot.
I panicked so I was not able to dig deeper down the issue. But I suspect it's because the video upload started before I leave my home (where wifi is available) and it somehow continued. I think a mechanism that cuts off the process when it disconnects from wifi when uploading has already started.

@Fricsion commented on GitHub (Sep 14, 2025): I am sorry I'm commenting on an issue closed yesterday (cheers to the devs) But just today, I caught Immich iOS app uploading video when it's on cellular. I am on the latest app (1.142.0 build 223) and beta timeline is enabled. It used like 500+ MB of data and I was able to catch it doing because the phone was very hot. I panicked so I was not able to dig deeper down the issue. But I suspect it's because the video upload started before I leave my home (where wifi is available) and it somehow continued. I think a mechanism that cuts off the process when it disconnects from wifi when uploading has already started.
Author
Owner

@leepfrog-ger commented on GitHub (Sep 15, 2025):

Can confirm, seeing the same

@leepfrog-ger commented on GitHub (Sep 15, 2025): Can confirm, seeing the same
Author
Owner

@leepfrog-ger commented on GitHub (Sep 18, 2025):

I did some more testing and at least on the last occurrence while the notification showed that is saying it is uploading media, it did not actually upload anything on cellular.
The upload only happened when I was on wifi.

Is that expected behavior that the notification is showing nevertheless? That cloud be confusing for users

@leepfrog-ger commented on GitHub (Sep 18, 2025): I did some more testing and at least on the last occurrence while the notification showed that is saying it is uploading media, it did not actually upload anything on cellular. The upload only happened when I was on wifi. Is that expected behavior that the notification is showing nevertheless? That cloud be confusing for users
Author
Owner

@alextran1502 commented on GitHub (Nov 9, 2025):

Implmentation is now different with the new upload, will open a new issue if needed

@alextran1502 commented on GitHub (Nov 9, 2025): Implmentation is now different with the new upload, will open a new issue if needed
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#770