Skip to content

Conversation

@FikriMilano
Copy link
Member

IMPORTANT: Where possible all PRs must be linked to a Github issue

Fixes #3772

works.webm

Engineer Checklist

  • I have written Unit tests for any new feature(s) and edge cases for bug fixes
  • I have added any strings visible on UI components to the strings.xml file
  • I have updated the CHANGELOG.md file for any notable changes to the codebase
  • I have run ./gradlew spotlessApply and ./gradlew spotlessCheck to check my code follows the project's style guide
  • I have built and run the FHIRCore app to verify my change fixes the issue and/or does not break the app
  • I have checked that this PR does NOT introduce breaking changes that require an update to Content and/or Configs? If it does add a sample here or a link to exactly what changes need to be made to the content.

Code Reviewer Checklist

  • I have verified Unit tests have been written for any new feature(s) and edge cases
  • I have verified any strings visible on UI components are in the strings.xml file
  • I have verifed the CHANGELOG.md file has any notable changes to the codebase
  • I have verified the solution has been implemented in a configurable and generic way for reuseable components
  • I have built and run the FHIRCore app to verify the change fixes the issue and/or does not break the app

On first time login, `account` will be null, then NPE crash happens.
Prevents a situation: from home screen to login screen, but then immediately goes back to home screen.
@FikriMilano FikriMilano requested a review from Rkareko August 24, 2025 10:42
@codecov
Copy link

codecov bot commented Aug 24, 2025

Codecov Report

❌ Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 25.3%. Comparing base (b4b5028) to head (0a893be).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
...re/engine/data/remote/shared/TokenAuthenticator.kt 66.6% 0 Missing and 1 partial ⚠️
...tregister/fhircore/quest/ui/login/LoginActivity.kt 0.0% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##              main   #3773     +/-   ##
=========================================
- Coverage     30.0%   25.3%   -4.8%     
+ Complexity     915     815    -100     
=========================================
  Files          287     297     +10     
  Lines        15409   16080    +671     
  Branches      2703    2810    +107     
=========================================
- Hits          4628    4072    -556     
- Misses       10215   11494   +1279     
+ Partials       566     514     -52     
Flag Coverage Δ
engine 60.7% <66.6%> (-0.1%) ⬇️
geowidget 18.7% <ø> (+0.7%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...re/engine/data/remote/shared/TokenAuthenticator.kt 74.0% <66.6%> (-0.4%) ⬇️
...tregister/fhircore/quest/ui/login/LoginActivity.kt 7.4% <0.0%> (-2.1%) ⬇️

... and 63 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

account.type,
accountManager.peekAuthToken(account, AUTH_TOKEN_TYPE),
)
secureSharedPreference.deleteCredentials()
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you explain what was happening before this line was added.

Copy link
Member Author

@FikriMilano FikriMilano Aug 25, 2025

Choose a reason for hiding this comment

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

Without this 1 line change, and while the other new changes are implemented:

When user logs out, app navigates to login page but then immiediately goes back to the hope page, because all this time, the user credentials stays even after log out where it should have been deleted.

@Rkareko
Copy link
Contributor

Rkareko commented Aug 25, 2025

@FikriMilano could you add some tests to cover the updates made on this PR

FikriMilano added a commit that referenced this pull request Nov 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

User cannot auto login after clearing the app from ram

3 participants