Skip to content

fix: add missing awaits when changing client certificate#20189

Merged
alextran1502 merged 1 commit intoimmich-app:mainfrom
jfly:add-missing-awaits-when-updating-client-cert
Jul 25, 2025
Merged

fix: add missing awaits when changing client certificate#20189
alextran1502 merged 1 commit intoimmich-app:mainfrom
jfly:add-missing-awaits-when-updating-client-cert

Conversation

@jfly
Copy link
Contributor

@jfly jfly commented Jul 25, 2025

I ran into this while testing out
#19830. When I add, change, or remove a client certificate under Immich's advanced settings, the change wouldn't take effect until some mysterious point in the future. For example:

  1. Add a client certificate. It doesn't get used.
  2. Remove certificate. Now the client certificate from step 1) is used.
  3. Restart application. Now no client certificate is used.

This all boils down to some missing awaits. The user would change the cert, and we'd start asynchronously saving it to the store, and while the save is still happening, HttpSSLOptions pulls the "old" value out of SSLClientCertStoreVal.

With the appropriate awaits, this behaves much more sanely.

@shenlong-tanwen
Copy link
Member

@jfly Can you fix the failing lint? Thanks

@jfly jfly force-pushed the add-missing-awaits-when-updating-client-cert branch 2 times, most recently from e31e16b to ec9871f Compare July 25, 2025 01:38
I ran into this while testing out
<immich-app#19830>. When I add, change,
or remove a client certificate under Immich's advanced settings, the
change wouldn't take effect until some mysterious point in the future.
For example:

1. Add a client certificate. It doesn't get used.
2. Remove certificate. *Now* the client certificate from step 1) is used.
3. Restart application. Now no client certificate is used.

This all boils down to some missing `await`s. The user would change the
cert, and we'd start asynchronously saving it to the store, and while
the save is still happening, [`HttpSSLOptions` pulls the "old" value out of
`SSLClientCertStoreVal`](https://github.com/immich-app/immich/blob/v1.136.0/mobile/lib/utils/http_ssl_options.dart#L30).

With the appropriate `await`s, this behaves much more sanely.
@jfly jfly force-pushed the add-missing-awaits-when-updating-client-cert branch from ec9871f to 7cf8342 Compare July 25, 2025 04:57
@alextran1502 alextran1502 merged commit de67d22 into immich-app:main Jul 25, 2025
44 checks passed
@jfly jfly deleted the add-missing-awaits-when-updating-client-cert branch July 25, 2025 05:29
ollioddi pushed a commit to ollioddi/immich that referenced this pull request Aug 11, 2025
…p#20189)

I ran into this while testing out
<immich-app#19830>. When I add, change,
or remove a client certificate under Immich's advanced settings, the
change wouldn't take effect until some mysterious point in the future.
For example:

1. Add a client certificate. It doesn't get used.
2. Remove certificate. *Now* the client certificate from step 1) is used.
3. Restart application. Now no client certificate is used.

This all boils down to some missing `await`s. The user would change the
cert, and we'd start asynchronously saving it to the store, and while
the save is still happening, [`HttpSSLOptions` pulls the "old" value out of
`SSLClientCertStoreVal`](https://github.com/immich-app/immich/blob/v1.136.0/mobile/lib/utils/http_ssl_options.dart#L30).

With the appropriate `await`s, this behaves much more sanely.
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