From dda52aac344e350701bda306701ebfdf92a02260 Mon Sep 17 00:00:00 2001 From: Ruslan Cheremin Date: Mon, 9 Sep 2024 18:26:31 +0200 Subject: [PATCH] [vfs][cleanup] remove VFS recovery notification + Notification about VFS recovery was introduced in 241, to make user aware that delayed IDE startup is due to VFS recovery, which was caused (likely) by user actions (e.g. kill-ing the IDE). That notification causes a lot of misunderstanding/misinterpretation, so it was quickly disabled by default in Release versions, left only in EAP -- and a bit later disabled in EAP also. Now it is time to get rid of it entirely GitOrigin-RevId: 34d923db37fdfd16fbb13cf5bbf915d2bca5664f --- .../resources/messages/IdeBundle.properties | 4 -- .../newvfs/persistent/PersistentFSImpl.java | 49 ------------------- .../src/META-INF/LangExtensions.xml | 2 - 3 files changed, 55 deletions(-) diff --git a/platform/platform-api/resources/messages/IdeBundle.properties b/platform/platform-api/resources/messages/IdeBundle.properties index 778127fd629a..421c8f3a4fb4 100644 --- a/platform/platform-api/resources/messages/IdeBundle.properties +++ b/platform/platform-api/resources/messages/IdeBundle.properties @@ -1,9 +1,5 @@ notification.group.ide.errors=IDE errors -notification.group.vfs=Virtual file system -notification.vfs.vfs-recovered.notification.title={0} took longer to launch -notification.vfs.vfs-recovered.notification.text=File system caches contained errors, and {0} required some time to repair them. \ -Such errors are usually caused by an improper shutdown or crash. notification.group.browser.config.problems=Browser configuration problems notification.title.browser.config.problem=Browser configuration problem diff --git a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/PersistentFSImpl.java b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/PersistentFSImpl.java index 152bd95512ea..03f820d956fe 100644 --- a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/PersistentFSImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/PersistentFSImpl.java @@ -5,17 +5,10 @@ import com.intellij.concurrency.ConcurrentCollectionFactory; import com.intellij.concurrency.JobSchedulerImpl; import com.intellij.diagnostic.Activity; import com.intellij.diagnostic.StartUpMeasurer; -import com.intellij.ide.IdeBundle; import com.intellij.ide.plugins.DynamicPluginListener; import com.intellij.ide.plugins.IdeaPluginDescriptor; -import com.intellij.notification.Notification; -import com.intellij.notification.NotificationGroup; -import com.intellij.notification.NotificationGroupManager; import com.intellij.openapi.Disposable; -import com.intellij.openapi.actionSystem.ActionManager; -import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.application.Application; -import com.intellij.openapi.application.ApplicationNamesInfo; import com.intellij.openapi.diagnostic.ControlFlowException; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.diagnostic.ThrottledLogger; @@ -39,7 +32,6 @@ import com.intellij.openapi.vfs.newvfs.events.*; import com.intellij.openapi.vfs.newvfs.impl.*; import com.intellij.openapi.vfs.newvfs.persistent.IPersistentFSRecordsStorage.RecordForRead; import com.intellij.openapi.vfs.newvfs.persistent.IPersistentFSRecordsStorage.RecordReader; -import com.intellij.openapi.vfs.newvfs.persistent.recovery.VFSInitializationResult; import com.intellij.openapi.vfs.newvfs.persistent.recovery.VFSRecoveryInfo; import com.intellij.openapi.vfs.pointers.VirtualFilePointerManager; import com.intellij.platform.diagnostic.telemetry.PlatformScopesKt; @@ -72,9 +64,7 @@ import java.util.concurrent.atomic.AtomicLong; import java.util.function.Function; import static com.intellij.configurationStore.StorageUtilKt.RELOADING_STORAGE_WRITE_REQUESTOR; -import static com.intellij.notification.NotificationType.INFORMATION; import static com.intellij.util.SystemProperties.getBooleanProperty; -import static com.intellij.util.SystemProperties.getLongProperty; import static java.util.concurrent.TimeUnit.NANOSECONDS; import static java.util.concurrent.TimeUnit.SECONDS; @@ -87,18 +77,6 @@ public final class PersistentFSImpl extends PersistentFS implements Disposable { private static final boolean LOG_NON_CACHED_ROOTS_LIST = getBooleanProperty("PersistentFSImpl.LOG_NON_CACHED_ROOTS_LIST", false); - /** - * Show notification about successful VFS recovery if VFS init takes longer than [nanoseconds] - *
- * By default notification is off completely: there is too much controversy about it's - * usefulness and wording, and from the other side -- so far recovery seems to work smoothly - * enough, so user doesn't really need to even know about it. - * TODO RC: consider removing it completely in the v243, if not re-requested - */ - private static final long NOTIFY_OF_RECOVERY_IF_LONGER_NS = SECONDS.toNanos( - getLongProperty("vfs.notify-user-if-recovery-longer-sec", Long.MAX_VALUE) - ); - /** * Sometimes PFS got request for the files with lost (missed) roots. We try to resolve each root against persistence, * and it is quite expensive, so we don't want to repeat that attempt for the same root, if it is found to be missed. @@ -221,14 +199,6 @@ public final class PersistentFSImpl extends PersistentFS implements Disposable { VFSRecoveryInfo recoveryInfo = _vfsPeer.connection().recoveryInfo(); List recoveredErrors = recoveryInfo.recoveredErrors; if (!recoveredErrors.isEmpty()) { - - //if there was recovery, and it took long enough for user to notice: - VFSInitializationResult initializationResult = _vfsPeer.initializationResult(); - if (app != null && !app.isHeadlessEnvironment() - && initializationResult.totalInitializationDurationNs > NOTIFY_OF_RECOVERY_IF_LONGER_NS) { - showNotificationAboutLongRecovery(); - } - //refresh the folders there something was 'recovered': refreshSuspiciousDirectories(recoveryInfo.directoriesIdsToRefresh()); } @@ -258,25 +228,6 @@ public final class PersistentFSImpl extends PersistentFS implements Disposable { } } - private static void showNotificationAboutLongRecovery() { - NotificationGroup notificationGroup = NotificationGroupManager.getInstance().getNotificationGroup("VFS"); - if (notificationGroup != null) { - ApplicationNamesInfo names = ApplicationNamesInfo.getInstance(); - Notification notification = notificationGroup.createNotification( - IdeBundle.message("notification.vfs.vfs-recovered.notification.title", names.getFullProductName()), - IdeBundle.message("notification.vfs.vfs-recovered.notification.text", names.getFullProductName()), - INFORMATION - ) - .setDisplayId("VFS.recovery.happened") - .setImportant(false); - AnAction reportProblemAction = ActionManager.getInstance().getAction("ReportProblem"); - if (reportProblemAction != null) { - notification = notification.addAction(reportProblemAction); - } - notification.notify(/*project: */ null); - } - } - @ApiStatus.Internal public boolean isConnected() { return myConnected.get(); diff --git a/platform/platform-resources/src/META-INF/LangExtensions.xml b/platform/platform-resources/src/META-INF/LangExtensions.xml index b3db683a2231..fcdb57e0e9bb 100644 --- a/platform/platform-resources/src/META-INF/LangExtensions.xml +++ b/platform/platform-resources/src/META-INF/LangExtensions.xml @@ -1668,8 +1668,6 @@ -