-
Notifications
You must be signed in to change notification settings - Fork 17
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
Fixing session and profile dependent providers initialization #1365
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1365 +/- ##
=======================================
+ Coverage 12% 12% +1%
=======================================
Files 266 266
Lines 7194 7198 +4
=======================================
+ Hits 802 803 +1
- Misses 6392 6395 +3 |
humn, have we disabled the multiple providers parallel loading with this? For example, after session is available and home page is displayed, we want to get exams and lectures in parallel. Is this approach doing it? |
That's a good point, I don't think providers are doing any parallel loading now |
Nevermind, I think parallel loading is working. These changes were made to the ensureInitialized method.
This does bring another question to mind: don't we have a "no-unawaited-futures" lint enabled? If yes, why wasn't this caught earlier? |
maybe because |
Hmm, maybe |
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.
Besides the currently discussing, I will approve this as it works!
Closes #1364
The
ExamProvider
is dependent on both the session and profile, so these must be initialized first. In theensureInitialized
function, theloadFromStorage
method is called beforeloadFromRemote
. However, the second method was not awaited, which meant that after login,ExamProvider
was accessing an empty profile state returned byloadFromStorage
. This could not be covered byloadFromRemote
, as it would not have completed in time.Review checklist
whatsnew/whatsnew-pt-PT
changelog.md
with the change