Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add account verification, improve login error messages, fix "account removal" and more #1099

Merged
merged 21 commits into from
Aug 2, 2023

Conversation

MV-GH
Copy link
Collaborator

@MV-GH MV-GH commented Jul 26, 2023

  • Refactor login and improve the error messages
  • Changes to the drawerheader so that it still shows user when site retrieval fails, so that users don't think their account is removed
  • Add account verification checks (With snackbar UI interaction)
  • Add warning icon in drawer header if account is in bad state
  • update baselines profiles
  • update benchmarks deps
  • Refactor Account? to Account, with AnonAccount as Unit
  • Prevent unnecessary API call to /site when starting up
  • Clean up some TODOs
  • Update gradle
  • Make our HttpClient as singleton (do not recreate it)

Account verification checks:

  • Check if device has internet capability
  • Check if instance is alive
  • Check if account is deleted
  • Check if jwt is still valid
  • Check if site is successfully retrieved
  • Check if email required is done
  • Check if account application approved

Not sure if email required check and account approval are needed even at this point.
Regarding the banned check I need some more info, see matrix

If there are any missing checks let me know rather add it here than later in SQL migrations

Currently it checks accounts in HomeActivity on startup and in every action requiring a account
It invalidates the account when the /site retrieval fails or when a authenticated user /site User portion is missing (JWT invalid).

This ended up being much bigger than I originally anticipated.

EMkIDe1n9l.mp4

This should fix the following:
fixes #1079
fixes #1057
fixes #1053
fixes #1004
fixes #931
fixes #547

@MV-GH
Copy link
Collaborator Author

MV-GH commented Jul 26, 2023

I did notice that the instance alive check fails in emulators due them not having ICMP support. Not sure what to do yet with that

Hmm apparently some cellular providers also block ICMPs, ig it is not reliable enough to use it. What else should I do? check a API endpoint??

@MV-GH
Copy link
Collaborator Author

MV-GH commented Jul 29, 2023

I am now using a different method to calculate instance is alive, which does not suffer from the issue with the previous method.

studio64_HRvhBFR1mx.mp4

MV-GH added 2 commits July 29, 2023 08:02
# Conflicts:
#	app/src/main/java/com/jerboa/ui/components/community/CommunityActivity.kt
MV-GH added 5 commits July 30, 2023 20:10
# Conflicts:
#	app/src/main/java/com/jerboa/ui/components/home/HomeActivity.kt
#	app/src/main/java/com/jerboa/ui/components/report/comment/CreateCommentReportActivity.kt
#	app/src/main/java/com/jerboa/ui/components/report/post/CreatePostReportActivity.kt
#	app/src/main/res/values/strings.xml
@twizmwazin twizmwazin merged commit 0511b00 into LemmyNet:main Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment