Automatic URL Switching Fails on Home Wi-Fi #7928

Open
opened 2026-02-05 13:25:11 +03:00 by OVERLORD · 10 comments
Owner

Originally created by @appu-sm on GitHub (Nov 25, 2025).

I have searched the existing issues, both open and closed, to make sure this is not a duplicate report.

  • Yes

The bug

The "Automatic URL Switching" feature, intended to seamlessly toggle between a local IP, when on home Wi-Fi and a public URL, when on an external network, is not working. The application always connects over the public URL, even when the device is confirmed to be connected to the home Wi-Fi network. When attempting to manually trigger "Use Current Connection," the application returns the error message: "Could not get Wi-Fi name."

The OS that Immich Server is running on

Debian

Version of Immich Server

v2.3.1

Version of Immich Mobile App

v2.3.1

Platform with the issue

  • Server
  • Web
  • Mobile

Device make and model

Pixel 9 Android 16

Your docker-compose.yml content

services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    volumes:
      - ${PERSONAL_DATA_PATH}:/data
      - /etc/localtime:/etc/localtime:ro
      - ${PERSONAL_PHOTOS_PATH}:/photos
    env_file:
      - .env
    ports:
      - '${APP_PORT}:2283'
    depends_on:
      - redis
      - database
    restart: always
    healthcheck:
      disable: false

  immich-machine-learning:
    container_name: immich_machine_learning
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
    volumes:
      - model-cache:/cache
    env_file:
      - .env
    restart: always
    healthcheck:
      disable: false

  redis:
    container_name: immich_redis
    image: docker.io/valkey/valkey:8-bookworm@sha256:a137a2b60aca1a75130022d6bb96af423fefae4eb55faf395732db3544803280
    healthcheck:
      test: redis-cli ping || exit 1
    restart: always

  database:
    container_name: immich_postgres
    image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0@sha256:32324a2f41df5de9efe1af166b7008c3f55646f8d0e00d9550c16c9822366b4a
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
      POSTGRES_INITDB_ARGS: '--data-checksums'
    volumes:
      - ${DB_DATA_LOCATION}:/var/lib/postgresql/data
    shm_size: 128mb
    restart: always

volumes:
  model-cache:

Your .env content

# Application
APP_NAME=ImmichCloud
PERSONAL_DATA_PATH=/immichCloud
IMMICH_VERSION=v2.3.1
APP_PORT=81

# Database
DB_DATA_LOCATION=/immichCloud/postgres
DB_PASSWORD=
DB_USERNAME=
DB_DATABASE_NAME=immich

# Photos
PERSONAL_PHOTOS_PATH=/personalCloud/appu/files

Reproduction steps

  1. In mobile app, open settings by clicking on user icon and clicking on "settings" option.
  2. Click on Networking option.
  3. Enable "Automatic URL switching" toggle
  4. Click edit wifi Name and enter the home wifi name and local url
  5. Add public url of the server in external network section.
  6. Exit the app
  7. Connect to home wifi which was saved in step 5.
  8. Launch the app and click on user icon to see the details.
  9. In server url the app is connected to public url, instead of local url.
  10. Additional step, in the networking settings when clicking on "Use Current Connection", getting error message "Could not get wifi name".

NOTE:
I have provided full permission for the app.

Relevant log output


Additional information

Image
Originally created by @appu-sm on GitHub (Nov 25, 2025). ### I have searched the existing issues, both open and closed, to make sure this is not a duplicate report. - [x] Yes ### The bug The "Automatic URL Switching" feature, intended to seamlessly toggle between a local IP, when on home Wi-Fi and a public URL, when on an external network, is not working. The application always connects over the public URL, even when the device is confirmed to be connected to the home Wi-Fi network. When attempting to manually trigger "Use Current Connection," the application returns the error message: "Could not get Wi-Fi name." ### The OS that Immich Server is running on Debian ### Version of Immich Server v2.3.1 ### Version of Immich Mobile App v2.3.1 ### Platform with the issue - [ ] Server - [ ] Web - [x] Mobile ### Device make and model Pixel 9 Android 16 ### Your docker-compose.yml content ```YAML services: immich-server: container_name: immich_server image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release} volumes: - ${PERSONAL_DATA_PATH}:/data - /etc/localtime:/etc/localtime:ro - ${PERSONAL_PHOTOS_PATH}:/photos env_file: - .env ports: - '${APP_PORT}:2283' depends_on: - redis - database restart: always healthcheck: disable: false immich-machine-learning: container_name: immich_machine_learning image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release} volumes: - model-cache:/cache env_file: - .env restart: always healthcheck: disable: false redis: container_name: immich_redis image: docker.io/valkey/valkey:8-bookworm@sha256:a137a2b60aca1a75130022d6bb96af423fefae4eb55faf395732db3544803280 healthcheck: test: redis-cli ping || exit 1 restart: always database: container_name: immich_postgres image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0@sha256:32324a2f41df5de9efe1af166b7008c3f55646f8d0e00d9550c16c9822366b4a environment: POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_USER: ${DB_USERNAME} POSTGRES_DB: ${DB_DATABASE_NAME} POSTGRES_INITDB_ARGS: '--data-checksums' volumes: - ${DB_DATA_LOCATION}:/var/lib/postgresql/data shm_size: 128mb restart: always volumes: model-cache: ``` ### Your .env content ```Shell # Application APP_NAME=ImmichCloud PERSONAL_DATA_PATH=/immichCloud IMMICH_VERSION=v2.3.1 APP_PORT=81 # Database DB_DATA_LOCATION=/immichCloud/postgres DB_PASSWORD= DB_USERNAME= DB_DATABASE_NAME=immich # Photos PERSONAL_PHOTOS_PATH=/personalCloud/appu/files ``` ### Reproduction steps 1. In mobile app, open settings by clicking on user icon and clicking on "settings" option. 2. Click on Networking option. 3. Enable "Automatic URL switching" toggle 4. Click edit wifi Name and enter the home wifi name and local url 5. Add public url of the server in external network section. 6. Exit the app 7. Connect to home wifi which was saved in step 5. 8. Launch the app and click on user icon to see the details. 9. In server url the app is connected to public url, instead of local url. 10. Additional step, in the networking settings when clicking on "Use Current Connection", getting error message "Could not get wifi name". NOTE: I have provided full permission for the app. ### Relevant log output ```shell ``` ### Additional information <img width="1080" height="2424" alt="Image" src="https://github.com/user-attachments/assets/90d6cddc-ed80-4967-aa81-887804807bd5" />
Author
Owner

@aswanth6000 commented on GitHub (Nov 26, 2025):

@appu-sm try removing the /api endpoint from the URL.

@aswanth6000 commented on GitHub (Nov 26, 2025): @appu-sm try removing the /api endpoint from the URL.
Author
Owner

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

Could you let me know whether you granted accuracy location permission, the WIFI feature needs that to properly read the WIFI name

@alextran1502 commented on GitHub (Nov 26, 2025): Could you let me know whether you granted accuracy location permission, the WIFI feature needs that to properly read the WIFI name
Author
Owner

@pa3m commented on GitHub (Nov 27, 2025):

Same issue for me on iPhone 12 with Immich App version 2.3.0 build.236. The location permission is granted to alway on.

@pa3m commented on GitHub (Nov 27, 2025): Same issue for me on iPhone 12 with Immich App version 2.3.0 build.236. The location permission is granted to alway on.
Author
Owner

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

Please make sure to have these two selected and enabled

Image
@alextran1502 commented on GitHub (Nov 27, 2025): Please make sure to have these two selected and enabled <img width="860" height="1781" alt="Image" src="https://github.com/user-attachments/assets/fd7ca98d-8547-4c41-a52d-139d558f9c2a" />
Author
Owner

@Ender-Knight commented on GitHub (Nov 29, 2025):

Location on your phone must be turned on
I tried when the location was turned off it didn't work, but when it was turned on it worked.

@Ender-Knight commented on GitHub (Nov 29, 2025): Location on your phone must be turned on I tried when the location was turned off it didn't work, but when it was turned on it worked.
Author
Owner

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

I tried when the location was turned off it didn't work, but when it was turned on it worked.

Correct, the API to read the Wi-Fi name requires this permission to work. Why? Good question for Apple :D

@alextran1502 commented on GitHub (Nov 29, 2025): > I tried when the location was turned off it didn't work, but when it was turned on it worked. Correct, the API to read the Wi-Fi name requires this permission to work. Why? Good question for Apple :D
Author
Owner

@ReanimationXP commented on GitHub (Dec 1, 2025):

Why? Good question for Apple :D

infosec nerd here ;) it's bc allowing an app to read which wifi SSIDs you're near/connected to effectively tracks you. a number of services (or the app in question itself) can correlate a GPS location with where a given wifi SSID is present, since they typically don't move and also only cover a small area. if your intent was to hide your location, turning location off but leaving the ability to pull your wifi SSID or those around you on would render that effort insufficient. roundabout and not immediately obvious, but simple once you think about it.

@ReanimationXP commented on GitHub (Dec 1, 2025): > Why? Good question for Apple :D infosec nerd here ;) it's bc allowing an app to read which wifi SSIDs you're near/connected to effectively tracks you. a number of services (or the app in question itself) can correlate a GPS location with where a given wifi SSID is present, since they typically don't move and also only cover a small area. if your intent was to hide your location, turning location off but leaving the ability to pull your wifi SSID or those around you on would render that effort insufficient. roundabout and not immediately obvious, but simple once you think about it.
Author
Owner

@godzinilla commented on GitHub (Dec 14, 2025):

It's so annoying that you need to use the location services to make this function work. It's a really bad design decision tbh.

@godzinilla commented on GitHub (Dec 14, 2025): It's so annoying that you need to use the location services to make this function work. It's a really bad design decision tbh.
Author
Owner

@ReanimationXP commented on GitHub (Dec 15, 2025):

As I mentioned, it's Apple protecting you. Devs cannot do anything about that. However, I am having the same issue as OP where the detection is not working, even with the proper rights. The "current server address", if it is to be believed, remains stuck on the external URL as if I'm not at home, so something is wrong in the code for comparing what is being pulled as the current wifi address, vs what is stored in the "Wi-Fi Name" field. My "use current connection" button works fine and properly pulls the current wifi connection. It also, for some reason, puts the external server endpoint URL in the "Server Endpoint" field, erasing the internal IP I set..

I propose the following fixes:

  • Don't mess with the local server endpoint URL field when clicking "use current connection" - only pull the wifi. The user is likely already using an external URL if they are using this feature, and it just erases the IP I entered.
  • Cite a proper URL example, namely whether /api needs to be included or not. Do some string checking to be friendly to what the user entered.. it's easy to detect if it ends in '/api'
  • Check the code which compares the Wi-Fi Name stored value with the current SSID, because something is wrong. Even when they match, the Local Network Server Endpoint URL field is not being put to use, so some part of this code is broken.
@ReanimationXP commented on GitHub (Dec 15, 2025): As I mentioned, it's Apple protecting you. Devs cannot do anything about that. However, I am having the same issue as OP where the detection is not working, even with the proper rights. The "current server address", if it is to be believed, remains stuck on the external URL as if I'm not at home, so something is wrong in the code for comparing what is being pulled as the current wifi address, vs what is stored in the "Wi-Fi Name" field. My "use current connection" button works fine and properly pulls the current wifi connection. It also, for some reason, puts the external server endpoint URL in the "Server Endpoint" field, erasing the internal IP I set.. I propose the following fixes: - Don't mess with the local server endpoint URL field when clicking "use current connection" - only pull the wifi. The user is likely already using an external URL if they are using this feature, and it just erases the IP I entered. - Cite a proper URL example, namely whether /api needs to be included or not. Do some string checking to be friendly to what the user entered.. it's easy to detect if it ends in '/api' - Check the code which compares the Wi-Fi Name stored value with the current SSID, because something is wrong. Even when they match, the Local Network Server Endpoint URL field is not being put to use, so some part of this code is broken.
Author
Owner

@godzinilla commented on GitHub (Dec 18, 2025):

It's not just an Apple thing, the Android too.

@godzinilla commented on GitHub (Dec 18, 2025): It's not just an Apple thing, the Android too.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#7928