Closed DGoiana closed 1 month ago
Attention: Patch coverage is 0%
with 2 lines
in your changes missing coverage. Please review.
Project coverage is 12%. Comparing base (
77dca69
) to head (4be63c1
). Report is 5 commits behind head on develop.
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?
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 method is used by other providers (and lazy consumers) to ensure that their dependencies initialized before using them. There is no dependency across all providers. If anything, these changes make the method actually correct because:
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?
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 loadFromStorage
is being awaited and loadFromRemote
is inside the then
clause
Hmm, maybe I've confirmed that we do have the rule enabled https://github.com/leancodepl/flutter_corelibrary/blob/master/packages%2Fleancode_lint%2Flib%2Fanalysis_options.yaml#L146
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