-
-
Notifications
You must be signed in to change notification settings - Fork 490
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
bfix: handles error incase of unsuccessful logout #2420
bfix: handles error incase of unsuccessful logout #2420
Conversation
Our Pull Request Approval ProcessWe have these basic policies to make the approval process smoother for our volunteer team. Testing Your CodePlease make sure your code passes all tests. Our test code coverage system will fail if either of these two conditions occur:
The process helps maintain the overall reliability of the code base and is a prerequisite for getting your PR approved. Assigned reviewers regularly review the PR queue and tend to focus on PRs that are passing. ReviewersDo not assign reviewers. Our Queue Monitors will review your PR and assign them.
Reviewing Your CodeYour reviewer(s) will have the following roles:
Other🎯 Please be considerate of our volunteers' time. Contacting the person who assigned the reviewers is not advised unless they ask for your input. Do not @ the person who did the assignment otherwise. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Congratulations on making your first PR! 🎊 If you haven't already, check out our Contributing Guidelines and PR Reporting Guidelines to ensure that you are following our guidelines for contributing and creating PR.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #2420 +/- ##
========================================
Coverage 95.74% 95.74%
========================================
Files 152 152
Lines 7518 7518
========================================
Hits 7198 7198
Misses 320 320 ☔ View full report in Codecov by Sentry. |
cf3997d
to
18b869f
Compare
@CyberWake @Kevoniat Can you review this PR? |
@am-casper Please attach a video. |
@noman2002 This is after the bug fix. Before the bug was fixed, app crashes after logout if internet connectivity is weak |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When logged out, navigate it to the login screen not on the language selection screen.
7e73d75
to
7c49ced
Compare
@noman2002 updated the commit. Kindly have a look |
final bool isLogoutSuccessful = | ||
await model.logout(); | ||
if (!isLogoutSuccessful) { | ||
throw Error(); //checks whether the logout was successful or not. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this error catched ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@literalEval there's a catch block at line 316. please have a look at it.
@@ -14,10 +14,11 @@ class AppSettingViewModel extends BaseModel { | |||
/// None | |||
/// | |||
/// **returns**: | |||
/// None | |||
Future<void> logout() async { | |||
/// * `Future<bool>`: A [Future] that resolves to a [bool] value indicating whether the user has been logged out. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Write a small non-redundant sentence.
Like: "Logs the user out and returns logout status"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@literalEval updated.
This is an update on the PR merging freeze:
We decided to do this at the beginning of the weekend to give us all time to adjust PR code and create bug fixes that may arise. Update your code at or after midnight GMT on the morning of March 23, 2024. (5:30am IST). If your PRs have already been approved, request a re-review after fixing the conflicts and refactoring to the new |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine to me.
What kind of change does this PR introduce?
This fixes a bug. Error handing in case of unsuccessful logging out is improved.
Issue Number: #2416
Fixes #2416
Did you add tests for your changes?
Updated a couple of tests.
Summary
As a user, i don't want to not able to log out properly and stuck between the App Settings and Select Language screen, everytime a logout is unsuccessful.
Does this PR introduce a breaking change?
This fixes a critical bug, especially for users who have unstable internet connection.
Have you read the contributing guide?
Yes