Files
simplex-chat/apps
Narasimha-sc 10b88a02cb ui: don't commit profile picker state when the change failed
ActiveProfilePicker wrote the app-wide incognito preference before the
call that can fail, and never rolled it back, in both directions:

- selecting a profile set incognito=false, then, if
  apiChangeConnectionUser returned null, left the connection incognito
  while the preference said otherwise
- selecting Incognito set incognito=true before apiSetConnectionIncognito,
  and undid nothing when it returned null

Neither is visible at the time: the row reads the connection first
(showingInvitation.value?.conn?.incognito), which was not changed. It
surfaces on the next connection started with showingInvitation null,
which falls through to the preference.

Selecting a profile also closed the picker unconditionally, so a failed
apiChangeConnectionUser left the connection on the old profile with the
picker dismissed as if it had worked. Both APIs alert on error, so the
failure was reported - but the picker still closed.

Move all three inside the branch that runs only when the change landed.
2026-09-04 17:29:48 +00:00
..