ApplETS / Notre-Dame

The 4th generation of ÉTSMobile, the main gateway between the École de technologie supérieure and its students on mobile devices
Apache License 2.0
37 stars 12 forks source link

Fixed missing cache keys when loading profile page on first install #967

Closed DylanApardian closed 5 months ago

DylanApardian commented 5 months ago

⁉️ Related Issue

Closes #944

📖 Description

When launching the app right after it's installed, some cache keys don't exist. When calling:

we're getting the info and the programs exclusively from cache, even though they don't exist.

🧪 How Has This Been Tested?

☑️ Checklist before requesting a review

sonarcloud[bot] commented 5 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

github-actions[bot] commented 5 months ago

Coverage after merging feature/944-fix-profile-view-on-first-install into master will be

78.38%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
lib
   locator.dart4.35%100%100%4.35%28, 30–42, 45–49, 52–54
lib/core/constants
   preferences_flags.dart0%100%100%0%61, 66, 68, 70–72, 75, 77–80, 82, 84
   widget_helper.dart100%100%100%100%
   quick_links.dart100%100%100%100%
   emergency_procedures.dart100%100%100%100%
   markers.dart100%100%100%100%
lib/core/extensions
   webview_controller_extension.dart88.89%100%100%88.89%21
lib/core/managers
   cache_manager.dart0%100%100%0%30–31, 34–37, 40, 44, 46–50, 56, 58–61, 66, 68–71
   course_repository.dart84.55%100%100%84.55%193, 198, 204, 206, 210, 212–213, 216–222, 227, 229, 232, 234–236, 239–244, 248, 252–254, 256, 260, 330, 338, 340, 525–526, 76
   quick_link_repository.dart85.71%100%100%85.71%39–40
   settings_manager.dart89.15%100%100%89.15%221, 227, 230, 234, 236, 256, 258–259, 272, 274–276, 39, 88
   user_repository.dart93.52%100%100%93.52%131–132, 182, 304, 306, 94–95
lib/core/models
   quick_link.dart100%100%100%100%
   quick_link_data.dart100%100%100%100%
   widget_models.dart100%100%100%100%
   feedback_issue.dart100%100%100%100%
   discovery.dart100%100%100%100%
   group_discovery.dart100%100%100%100%
   faq_actions.dart100%100%100%100%
   faq_questions.dart100%100%100%100%
   emergency_procedure.dart100%100%100%100%
lib/core/services
   analytics_service.dart0%100%100%0%13–14, 17, 20–22, 25, 30, 32–34, 38, 40–41, 43
   app_widget_service.dart77.42%100%100%77.42%71, 73–78
   github_api.dart0%100%100%0%100–101, 104, 106, 110, 112–116, 118–119, 122, 124, 131–134, 138–139, 141, 39, 42–43, 47, 51–55, 57–58, 60, 62, 64–65, 68, 70, 77, 82–88, 92, 94, 96–98
   in_app_review_service.dart0%100%100%0%16, 20, 23, 27
   internal_info_service.dart0%100%100%0%18–21, 24–29, 32, 34–38, 42–43
   launch_url_service.dart0%100%100%0%22–24, 27–29, 32–37, 43, 61–62, 65
   navigation_service.dart0%100%100%0%27, 30–31, 33–34, 41–42, 45–46, 49–51, 53, 58, 61, 63–64, 67–69, 71–72
   networking_service.dart0%100%100%0%10–11, 13–15, 18–20
   preferences_service.dart69.09%100%100%69.09%119–120, 122, 36, 38, 40, 43–45, 69–70, 80–82, 85, 87–88
   remote_config_service.dart0%100%100%0%101–103, 106–108, 111–112, 114–118, 122–124, 46–48, 51–53, 56–58, 61–63, 66–68, 71–73, 76–78, 81–83, 86–88, 91–93, 96–98
   rive_animation_service.dart0%100%100%0%12–13, 16, 19–20, 28, 32–33, 35
   siren_flutter_service.dart0%100%100%0%13–14, 18–19, 23–25, 29–31, 35, 41
lib/core/utils
   cache_exception.dart100%100%100%100%
   animation_exception.dart20%100%100%20%15, 17–19
   utils.dart70.83%100%100%70.83%12–15, 17–18, 49
   login_mask.dart5%100%100%5%12, 15–16, 18–20, 23–30, 33–34, 37–39
lib/core/viewmodels
   profile_viewmodel.dart96%100%100%96%126–127
   schedule_viewmodel.dart79.47%100%100%79.47%100, 102–106, 108, 123, 147, 164, 166–167, 169, 171–176, 215, 227, 283–284, 320, 370–374, 382–383, 406–409, 412–413, 446–447
   dashboard_viewmodel.dart80.88%100%100%80.88%146–148, 150, 153, 240–241, 255–260, 262, 271–272, 314, 354–355, 357, 377, 381, 418, 420, 425, 463, 478, 480–482, 484, 489–490, 546, 551, 553–554, 556–557, 560–561, 563, 566, 568, 570–571, 573–574, 577–578, 590–591
   grades_details_viewmodel.dart96.67%100%100%96.67%53
   not_found_viewmodel.dart100%100%100%100%
   choose_language_viewmodel.dart100%100%100%100%
   web_link_card_viewmodel.dart62.50%100%100%62.50%35, 40–41
   faq_viewmodel.dart41.67%100%100%41.67%30, 32–33, 35, 38, 41, 43
   startup_viewmodel.dart92.50%100%100%92.50%103, 138–139
   login_viewmodel.dart100%100%100%100%
   settings_viewmodel.dart100%100%100%100%
   schedule_default_viewmodel.dart95%100%100%95%98–99
   feedback_viewmodel.dart97.14%100%100%97.14%63
   more_viewmodel.dart64.71%100%100%64.71%110, 112–114, 116–117, 119, 124–125, 144–145, 147–148, 150–151, 154–155, 64
   quick_links_viewmodel.dart100%100%100%100%
   grades_viewmodel.dart100%100%100%100%
   schedule_settings_viewmodel.dart77.38%100%100%77.38%118–122, 138, 140, 142, 145, 148–149, 151, 65, 67–72
   security_viewmodel.dart50%100%100%50%37–38, 42–44, 46, 51–52
lib/ui/utils
   app_theme.dart0%100%100%0%103, 118–123, 6, 74–76, 78–80, 89–92, 96–98
   discovery_components.dart93.23%100%100%93.23%103, 134, 165, 195, 225, 41, 459, 466–467, 469, 471–476, 72
   loading.dart100%100%100%100%
lib/ui/views
   grades_view.dart93.22%100%100%93.22%117, 119, 144, 49
   feedback_view.dart71.60%100%100%71.60%109, 112–113, 115–119, 121, 126, 130, 132–134, 137–140, 142, 151–153, 160–166, 283–284, 333–335, 337, 339, 341, 343, 39–40, 42–43, 67–68, 70–71
   more_view.dart83.72%100%100%83.72%110–112, 161–162, 164, 204–205, 207, 211, 243–245, 247, 249–251, 44–45, 64–65