Skip to content

Conversation

@dcl09
Copy link

@dcl09 dcl09 commented Nov 23, 2025

Closes #1717

Clears user data base cache on logout

Review checklist

  • Terms and conditions reflect the changes

View Changes

  • Description has screenshots of the UI changes.
  • Tested both in light and dark mode.
  • New text is both in portuguese (PT) and english (EN).
  • Works in different text zoom levels.
  • Works in different screen sizes.

Performance

  • No helper functions to return widgets are added. New widgets are created instead.
  • Used ListView.builder for Long Lists.
  • Controllers (TextEditingController, ...) are beeing disposed of in dispose() method.

@codecov
Copy link

codecov bot commented Nov 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60%. Comparing base (df5f88d) to head (2c07800).
⚠️ Report is 16 commits behind head on develop.

❌ Your project check has failed because the head coverage (60%) is below the target coverage (70%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@           Coverage Diff           @@
##           develop   #1736   +/-   ##
=======================================
  Coverage       60%     60%           
=======================================
  Files            2       2           
  Lines           81      81           
=======================================
  Hits            48      48           
  Misses          33      33           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@pedroafmonteiro pedroafmonteiro left a comment

Choose a reason for hiding this comment

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

Thanks for this!

Copy link
Contributor

@AugustoVSoares AugustoVSoares left a comment

Choose a reason for hiding this comment

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

When I'm testing the database is not being cleared properly (CourseUnit, Profile, Meal, Course are still saved after I logout). The function call Database().clear() is already ran inside the NavigationService.logoutAndPopHistory() function (it then runs unawaited(cleanupStoredData(context)) which should supposedly clear the database).
Remember to checkout the README.md in packages/uni_app/ for instructions on how to check the database to test properly!

@pedroafmonteiro pedroafmonteiro changed the title Clear cache properly on logout fix: clear cache properly on logout Dec 5, 2025
@dcl09
Copy link
Author

dcl09 commented Dec 11, 2025

Fixes:

  • Race Condition: Cleanup now finishes before navigation.
  • Safety: Removed unsafe DB file deletion.
  • Logic: Session persistence is now properly reset on logout.

Copy link
Contributor

@AugustoVSoares AugustoVSoares left a comment

Choose a reason for hiding this comment

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

Sorry i forgot to send my review a while ago 😅 .
All the user sensitive data is being cleared on logout (nice 👍 ). However, I've noticed the Meal table is still not being cleared. Please check that, and let me know! (PS: Message me on slack so I don't forget to re-review this 😵 .)

@dcl09 dcl09 requested a review from AugustoVSoares December 27, 2025 22:01
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.

Make sure user sensitive cache is invalidated on logout.

6 participants