Skip to content

fix(mobile): sync custom headers back to widget#26035

Open
robinwit wants to merge 3 commits intoimmich-app:mainfrom
robinwit:fix/sync-custom-headers-to-widget
Open

fix(mobile): sync custom headers back to widget#26035
robinwit wants to merge 3 commits intoimmich-app:mainfrom
robinwit:fix/sync-custom-headers-to-widget

Conversation

@robinwit
Copy link

@robinwit robinwit commented Feb 8, 2026

Description

Sets kWidgetCustomHeaders when changing the headers in the app (advanced settings), similar as in saveAuthInfo(), otherwise widgets keep using the old credentials.

This fixes "No assets available" shown in widgets when a certain header is required and it was correctly set in the app. Should I create an issue for this?

How Has This Been Tested?

On my iPhone with my Immich instance behind an Nginx with auth_request that is configured to be skipped if a certain header is set (otherwise the app doesn't work: #3118):

Nginx config:

    location @noauth {
      proxy_pass http://immich_server:2283;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "upgrade";
    }

    location @error401 {
        return 302 https://oidc_server/login?url=$scheme://$http_host$request_uri&vouch-failcount=$auth_resp_failcount&X-Vouch-Token=$auth_resp_jwt&error=$auth_resp_err;
    }

    location / {
        error_page 599 = @noauth;

        if ($http_x_immich_bypass = "YOUR_SECRET_VALUE_HERE") {
            return 599;
        }

        auth_request /validate;
        error_page 401 = @error401;

        proxy_pass http://immich_server:2283;
        proxy_set_header   Upgrade    $http_upgrade;
        proxy_set_header   Connection "upgrade";
    }

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if applicable
  • I have no unrelated changes in the PR.
  • I have confirmed that any new dependencies are strictly necessary.
  • I have written tests for new code (if applicable)
  • I have followed naming conventions/patterns in the surrounding code
  • All code in src/services/ uses repositories implementations for database calls, filesystem operations, etc.
  • All code in src/repositories/ is pretty basic/simple and does not have any immich specific logic (that belongs in src/services/)

Please describe to which degree, if any, an LLM was used in creating this pull request.

Claude Opus 4.5 for pinpointing the issue.

@robinwit robinwit requested a review from bwees February 12, 2026 21:00
Copy link
Member

@bwees bwees left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bwees bwees force-pushed the fix/sync-custom-headers-to-widget branch from b084075 to 7da83e4 Compare February 14, 2026 05:52
@bwees
Copy link
Member

bwees commented Feb 14, 2026

@robinwit can you give this a test on your setup after the refactorings that we made?

Copy link
Member

@mertalev mertalev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd really like to minimize the number of places that need these headers to be kept in sync. With #25942, headers are set and persisted platform-side. Widgets have access to them with UserDefaults and SharedPreferences, so they could use this without needing to also sync here.

@bwees
Copy link
Member

bwees commented Feb 19, 2026

I'd really like to minimize the number of places that need these headers to be kept in sync. With #25942, headers are set and persisted platform-side. Widgets have access to them with UserDefaults and SharedPreferences, so they could use this without needing to also sync here.

Ah perfect. @robinwit can you adjust the implementation for widgets to use the headers that are already persisted? We can delete the existing header sync that is exclusive to widgets in favor of the new platform side header source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants