Skip to content

Fix: validate the login status for logged-in-required screens#6643

Open
cooltey wants to merge 8 commits into
mainfrom
assert-user-exception
Open

Fix: validate the login status for logged-in-required screens#6643
cooltey wants to merge 8 commits into
mainfrom
assert-user-exception

Conversation

@cooltey
Copy link
Copy Markdown
Collaborator

@cooltey cooltey commented May 28, 2026

What does this do?

This prevents the user from seeing the errors in the Activity tab, Year-in-Review, or Watchlist, as the cookie may have expired, but the app still believes the user is logged in.

This PR creates an MwCoroutineExceptionHandler in ThrowableUtil, and replaces the general CoroutineExceptionHandler to catch the assertuserfailed or notloggedin error code. If it catches one of the error codes, the app will log out the user and prompt the login dialog to do relogin.

Phabricator:
https://phabricator.wikimedia.org/T427439

@cooltey cooltey requested review from Williamrai and dbrant as code owners May 28, 2026 03:43
@cooltey cooltey changed the title Fix: add assert=user for login-required requests to avoid showing error codes Fix: validate the login status for logged-in-required screens May 28, 2026
Copy link
Copy Markdown
Member

@dbrant dbrant left a comment

Choose a reason for hiding this comment

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

This is the correct path, but will need some more behavioral updates.

Comment thread app/src/main/java/org/wikipedia/dataclient/Service.kt
Comment thread app/src/main/java/org/wikipedia/activitytab/ActivityTabViewModel.kt Outdated
Comment thread app/src/main/java/org/wikipedia/watchlist/WatchlistViewModel.kt Outdated
@cooltey cooltey requested a review from dbrant May 29, 2026 02:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants