mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-08-14 11:30:18 +00:00
createUserRecordAt gates the "UPDATE users SET active_user = 0" on the activeUser argument but called getNextActiveOrder unconditionally, so a profile created with keepActiveUser got active_order = max + 1 despite never having been active. Every picker sorts on that column descending, so the new profile sorted above the profile actually in use - in the Android user picker, which sorts the full list, literally above the active one. active_order means "last activated" and setActiveUser is otherwise its only writer, so a profile that was never activated now keeps 0 and sorts last until it is used. Also asserts in the test that the created user's own record is not active: /u only covers the currentUser TVar, and it is the user record that the clients branch on to detect a core that ignored the flag. Moves the second test to "user profiles", which is what it tests - it has nothing to do with short links.