You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When ReloadPackages threw, the catch logged the exception and set IsLoading to false, but never raised FinishedLoading. The packages pages read "LoadsOnStart && !IsLoaded" as still-pending, so the page kept the "Loading packages" illustration forever -- and unlike the race fixed in #5387, navigating away and back re-ran FilterPackages against the same flags, so nothing short of hitting Reload cleared it.
Raise the event from the catch too, and have the pages ask HasPendingInitialLoad instead: a load that threw has concluded, even though it produced nothing. IsLoaded stays false on that path, so the callers that read it as "this list was never loaded, go fetch it" -- the IPC package list, the automatic updates editor, the maintenance scheduler's backup -- keep retrying exactly as they did before.
A FinishedLoading subscriber that throws unwinds into that same catch, so the announcement is guarded by a flag: a successful load whose subscriber threw must not fire the event a second time and re-run every handler that already ran, nor undo the state the success path just set. The announcement made from the catch is itself wrapped, so ReloadPackages still swallows what it swallowed before.
DiscoverablePackagesLoader re-arms its queued search from FinishedLoading, so a thrown load no longer strands that either.
When ReloadPackages threw, the catch logged the exception and set
IsLoading to false, but never raised FinishedLoading. The packages pages
read "LoadsOnStart && !IsLoaded" as still-pending, so the page kept the
"Loading packages" illustration forever -- and unlike the race fixed in
#5387, navigating away and back re-ran FilterPackages against the same
flags, so nothing short of hitting Reload cleared it.
Raise the event from the catch too, and have the pages ask
HasPendingInitialLoad instead: a load that threw has concluded, even
though it produced nothing. IsLoaded stays false on that path, so the
callers that read it as "this list was never loaded, go fetch it" -- the
IPC package list, the automatic updates editor, the maintenance
scheduler's backup -- keep retrying exactly as they did before.
A FinishedLoading subscriber that throws unwinds into that same catch,
so the announcement is guarded by a flag: a successful load whose
subscriber threw must not fire the event a second time and re-run every
handler that already ran, nor undo the state the success path just set.
The announcement made from the catch is itself wrapped, so ReloadPackages
still swallows what it swallowed before.
DiscoverablePackagesLoader re-arms its queued search from
FinishedLoading, so a thrown load no longer strands that either.
This flag avoids invoking the whole event twice, but a multicast event stops at the first throwing subscriber, so every later subscriber is skipped permanently. A handler registered before the page/sidebar handlers can therefore leave those consumers in their loading state even though this method swallows the exception. Invoke each FinishedLoading handler independently with per-handler exception isolation, and extend the test with a recorder registered after the throwing handler.
This issue also appears on line 284 of the same file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When ReloadPackages threw, the catch logged the exception and set IsLoading to false, but never raised FinishedLoading. The packages pages read "LoadsOnStart && !IsLoaded" as still-pending, so the page kept the "Loading packages" illustration forever -- and unlike the race fixed in #5387, navigating away and back re-ran FilterPackages against the same flags, so nothing short of hitting Reload cleared it.
Raise the event from the catch too, and have the pages ask HasPendingInitialLoad instead: a load that threw has concluded, even though it produced nothing. IsLoaded stays false on that path, so the callers that read it as "this list was never loaded, go fetch it" -- the IPC package list, the automatic updates editor, the maintenance scheduler's backup -- keep retrying exactly as they did before.
A FinishedLoading subscriber that throws unwinds into that same catch, so the announcement is guarded by a flag: a successful load whose subscriber threw must not fire the event a second time and re-run every handler that already ran, nor undo the state the success path just set. The announcement made from the catch is itself wrapped, so ReloadPackages still swallows what it swallowed before.
DiscoverablePackagesLoader re-arms its queued search from FinishedLoading, so a thrown load no longer strands that either.