Sign-in: a refused first sign-in stays on the sign-in screen with its error #89
Closed
ryoitsu69
wants to merge 0 commits from
ryoitsu69/anotherim-js:fix/sign-in-refusal-stays into develop
pull from: ryoitsu69/anotherim-js:fix/sign-in-refusal-stays
merge into: another-im:develop
another-im:develop
another-im:fix/touchscreen-pinch-zoom
another-im:fix/call-window-touch
another-im:fix/idle-cpu
another-im:fix/issue-69-changed-key
another-im:fix/relock-dismiss
another-im:fix/settings-accounts
another-im:feat/unified-dialogs-1
another-im:feat/unified-dialogs-2
another-im:feat/unified-dialogs-3
another-im:feat/one-status
another-im:macos-0.6.1
another-im:fix/console-tab-out
another-im:fix/desktop-drop
another-im:fix/xml-console-menu
another-im:feat/telegram-connect
another-im:feat/chat-tags
another-im:feat/muc-omemo
another-im:integrate/origin-develop-2026-10-02
another-im:fix/media-bubble-size
another-im:fix/empty-click-focus
another-im:feat/system-font-default
another-im:integrate/develop-2026-10-02
another-im:fix/attachment-decrypt
another-im:feat/system-font
another-im:fix/chat-links
another-im:fix/android-background-network
another-im:feat/tray
another-im:feat/thumb-cache
another-im:fix/android-csi-native
another-im:feat/opfs-store
another-im:fix/alttab-focus
another-im:try/groupcalls
another-im:feat/pwa-install
another-im:integrate/0.3.0
another-im:fix/upload-bubble-030
another-im:feat/drag-select
another-im:fix/upload-bubble
another-im:feat/encryption-info
another-im:chore/libtacky-path
another-im:feat/chat-header-menus
another-im:integrate/develop
another-im:fix/saved-top-linux-voice
another-im:fix/dialog-close-icons
another-im:feat/window-title-unread
another-im:feat/groupcalls
another-im:fix/open-picture-one-tap
another-im:feat/server-info-console
another-im:fix/chat-open-scroll-end
another-im:fix/desktop-push-mutes
another-im:fix/android-mute-push-selection
another-im:feat/otr-lock-colours
another-im:otr-v3-secret-chats
another-im:chore/remove-otr
another-im:feat/room-invites
another-im:feat/voice-video-messages
another-im:docs/readme
another-im:fix/android-empty-files
another-im:api-freeze
another-im:feat/push-counts
another-im:feat/h264-android-save
another-im:feat/keep-attachments-decrypted
another-im:feat/media-player
another-im:feat/fix-subdomain-attachments
another-im:feat/fonts-pt-sans
another-im:feat/always-decrypt-on-the-fly
another-im:feat/default-scale-125
another-im:fix/composer-focus-after-send
another-im:feat/android-native-calls
another-im:feat/media-stream-decrypt
another-im:feat/download-failure
another-im:feat/outbox-cap
another-im:feat/web-call-sheet
another-im:feat/first-run-push-check
another-im:feat/font-size-110
another-im:feat/log-view
another-im:fix/failed-transfer-history
another-im:feat/secure-unlock
another-im:feat/tpm-desktop
another-im:feat/tpm-android
another-im:feat/api-freeze-client
No reviewers
Labels
Clear labels
android
bug
Something is not working
duplicate
This issue or pull request already exists
feature request
New feature
linux
linux exclusive
macos
macos exclusive
needsinfo
Needs more information
severity: high
Major issue, significantly impacts usability or blocks core functionality
severity: low
Minor issue, cosmetic or rarely affects usage
severity: medium
Noticeable issue, but there is a workaround or limited impact
telegram_gw
issues related to the telegram gw
ui/ux
issues related to the interface and user experience (visual glitches, layout, interactions, usability problems)
windows
windows exclusive
wontfix
This won't be fixed
No labels
android
bug
duplicate
feature request
linux
macos
needsinfo
severity: high
severity: low
severity: medium
telegram_gw
ui/ux
windows
wontfix
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set
Reference
another-im/anotherim-js!89
Loading…
Reference in a new issue
No description provided.
Delete branch "ryoitsu69/anotherim-js:fix/sign-in-refusal-stays"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
After a first sign-in the server refuses, the error is not seen: the chats flash for a moment and the welcome screen comes back empty, with no message.
Cause
The error lives in
<aim-signin-card>, inside<aim-welcome>. On a refusal the card callsaccounts.removeand sendssign-in-failed, and the shell clearspendingSignIn. Butaccounts.removeonly asks: the row leaves withaccount <Removed>and the nextaccount list. While the list names the account,welcomePhasesaysdone, so the shell takes<aim-welcome>down with the card and its error, and a new empty one follows when the row goes.The order cannot be relied on either. Against a local ejabberd the refusal left
tackyd-json40 ms after its answer toaccount liston a first attempt and 5 ms after on later ones, andStore.#loadAccountsawaits more before the page has that answer, so the page can hear the refusal before the list names the account. A version of this fix that held the screen until the row left worked on the first attempt only.Fix
The shell keeps the address from
sign-in-failedasrefusedSignIn, and#welcomePhaseholds the screen while the list names no other account (s.accounts.every(...)), whether the row comes before the refusal or after it. The mark goes at the nextsign-in-pending, or when that address connects another way (onConnected), a code from another device, say. The add-account sheet is not touched: its card's events do not pass through<aim-welcome>.One case stays open, from reading the code, not run: after a refusal, a backup or a code that brings back only that same address keeps the welcome screen up until it connects. If it cannot connect, for example offline, the screen stays until a restart or a new sign-in.
Testing
welcome-shell.test.tsgains three tests: refusals in a row, a refusal heard before the list names the account, and a refused address connecting another way. All three fail on5f1ef7e8. The mock connects every enabled account, even a refused one, so they drop that event.make test-ui check test-shell webkit-smoke: 5146 passed, 8 skipped,checkclean, 442 shell tests passed, smoke 9575 checks, 0 failed.5f1ef7e8, before the rebase:Not run: Android.
🤖 Generated with Claude Code
5f1ef7e8. On a local ejabberd 26.09 a build with this change kept the error through 11 refused sign-ins in a row on the first-run screen. CHANGELOG under Unreleased. 52672b934aMerged (PR #89) and in anotherim-js 0.8.0-rc7 (https://dev.another.im/another-im/anotherim-js/releases/tag/v0.8.0-rc7): a refused first sign-in now keeps the sign-in screen and its error instead of flashing an empty welcome screen. The shell used to drop
pendingSignInas soon as the account's removal was asked for, but the removal and the server's refusal did not always arrive in that order; the screen now holds the address as a pending refusal until the account list actually drops it or it connects another way, so the error is shown whichever order the two answers come in.Please check with 0.8.0-rc7 or newer.
Pull request closed