From 7f13408fd0b4d40f4db950e0d9863b31cd15945a Mon Sep 17 00:00:00 2001 From: irengrig Date: Tue, 16 Aug 2022 13:32:09 +0200 Subject: [PATCH] Initialize Offline contribution on Restored phase In a rare case of the slow network, Chrome can signal that the network is offline during the VSCode initialization - while the workbench parts still were not created, but the Offline contribution was already registered (since Starting is an initial lifecycle stage). Then as assertion is thrown from the Offline contribution, and it only updates the color of the status bar, but does not place the 'Offline' status bar item - I think this may be confusing for users; also the status bar color will never change back if the attempt to change a status bar will happen during the Offline contribtion *construction* - there will be no code to change it back. Solution: initialize the Offline contribution later; this should not make a big difference. --- .../workbench/contrib/offline/browser/offline.contribution.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/offline/browser/offline.contribution.ts b/src/vs/workbench/contrib/offline/browser/offline.contribution.ts index 075a47e02c8c5..75b1671e327c5 100644 --- a/src/vs/workbench/contrib/offline/browser/offline.contribution.ts +++ b/src/vs/workbench/contrib/offline/browser/offline.contribution.ts @@ -94,4 +94,4 @@ export class OfflineStatusBarController implements IWorkbenchContribution { } Registry.as(Extensions.Workbench) - .registerWorkbenchContribution(OfflineStatusBarController, LifecyclePhase.Starting); + .registerWorkbenchContribution(OfflineStatusBarController, LifecyclePhase.Restored);