Make sure TC sync completes before select book in reload (BL-16327)#7931
Conversation
andrew-polk
left a comment
There was a problem hiding this comment.
@andrew-polk reviewed 3 files and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on JohnThomson).
src/BloomExe/Workspace/WorkspaceView.cs line 221 at r1 (raw file):
// If we're loading a team collection, we need to do that...with its progress dialog... // before anything else, and we'll need to close the splash screen to make room for // that dialog. // Note, this not put into _startupActions...it should never be disabled.
I'm not sure how much of this comment is even meaningful anymore, but it is at least misplaced now.
f9bbb6d to
5341f37
Compare
JohnThomson
left a comment
There was a problem hiding this comment.
@JohnThomson made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on andrew-polk).
src/BloomExe/Workspace/WorkspaceView.cs line 221 at r1 (raw file):
Previously, andrew-polk wrote…
// If we're loading a team collection, we need to do that...with its progress dialog... // before anything else, and we'll need to close the splash screen to make room for // that dialog. // Note, this not put into _startupActions...it should never be disabled.I'm not sure how much of this comment is even meaningful anymore, but it is at least misplaced now.
Done.
|
| Filename | Overview |
|---|---|
| src/BloomExe/MiscUI/StartupScreenManager.cs | Adds thread-safe milestone locking, a new derived "startupBookSelectionReady" milestone, ClearStartupMilestone, and a public StartupMilestoneHasBeenReached check. Logic is correct; minor undocumented invariant in EnsureDependentMilestonesAreSet. |
| src/BloomExe/TeamCollection/TeamCollection.cs | Adds StartupMilestoneReached("teamSyncCompleted") after the try/catch block so it fires regardless of sync success or failure — correct placement. |
| src/BloomExe/Workspace/WorkspaceView.cs | Switches SelectBookAtStartup wait milestone to "startupBookSelectionReady", clears milestones at start of OnLoad, and immediately sets "teamSyncCompleted" for non-TC collections. The third ClearStartupMilestone("startupBookSelectionReady") call is redundant but harmless. |
Reviews (1): Last reviewed commit: "Make sure TC sync completes before selec..." | Re-trigger Greptile
| private static void EnsureDependentMilestonesAreSet() | ||
| { | ||
| if ( | ||
| _milestones.Contains("teamSyncCompleted") | ||
| && _milestones.Contains("collectionButtonsDrawn") | ||
| ) | ||
| { | ||
| _milestones.Add("startupBookSelectionReady"); | ||
| } | ||
| } |
There was a problem hiding this comment.
EnsureDependentMilestonesAreSet only fires on addition, never on re-check
startupBookSelectionReady is derived from two prerequisites, but EnsureDependentMilestonesAreSet is only invoked inside StartupMilestoneReached. If both prerequisites are already set when a caller invokes ClearStartupMilestone("startupBookSelectionReady") directly (without clearing either prerequisite), startupBookSelectionReady is removed and no code path re-derives it until the next StartupMilestoneReached call. The current OnLoad flow is safe, but a brief comment on this invariant would help future maintainers.
andrew-polk
left a comment
There was a problem hiding this comment.
@andrew-polk reviewed 1 file and all commit messages, and resolved 1 discussion.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on JohnThomson).
This change is