From 962143dff411140f683a77bebb7fecc6b418cda3 Mon Sep 17 00:00:00 2001 From: Yuriy Artamonov Date: Sun, 16 Feb 2025 16:16:30 +0100 Subject: [PATCH] [feedback] IJPL-177421 Permanent CSAT survey in IDEs Do not show request feedback notifications twice (cherry picked from commit a5e2f3278ff19918725ba77dc592347a9ffc4d93) (cherry picked from commit e43e71f84d59e4ed26e1bef564393e44ed9045a6) IJ-MR-155667 GitOrigin-RevId: eda1992585305691e954b7356bc2d51f91542e49 --- .../platform/feedback/impl/IdleFeedbackResolver.kt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/platform/feedback/src/com/intellij/platform/feedback/impl/IdleFeedbackResolver.kt b/platform/feedback/src/com/intellij/platform/feedback/impl/IdleFeedbackResolver.kt index c4ccf02a3cbd..5354873a4631 100644 --- a/platform/feedback/src/com/intellij/platform/feedback/impl/IdleFeedbackResolver.kt +++ b/platform/feedback/src/com/intellij/platform/feedback/impl/IdleFeedbackResolver.kt @@ -2,13 +2,16 @@ package com.intellij.platform.feedback.impl import com.intellij.internal.statistic.utils.getPluginInfoByDescriptor +import com.intellij.notification.NotificationsManager import com.intellij.openapi.application.EDT import com.intellij.openapi.components.Service import com.intellij.openapi.components.service +import com.intellij.openapi.diagnostic.thisLogger import com.intellij.openapi.extensions.ExtensionPointName import com.intellij.openapi.project.Project import com.intellij.openapi.util.registry.Registry import com.intellij.platform.feedback.FeedbackSurvey +import com.intellij.platform.feedback.impl.notification.RequestFeedbackNotification import com.intellij.platform.feedback.impl.state.DontShowAgainFeedbackService import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers @@ -40,6 +43,13 @@ class IdleFeedbackResolver(private val cs: CoroutineScope) { return } + val feedbackNotifications = NotificationsManager.getNotificationsManager() + .getNotificationsOfType(RequestFeedbackNotification::class.java, project) + if (feedbackNotifications.isNotEmpty()) { + thisLogger().debug("There is already another request feedback notification shown") + return + } + cs.launch { val suitableFeedbackTypes = IdleFeedbackTypes.entries.filter { it.isSuitable() } val suitableIdleFeedbackSurveys = getJbIdleFeedbackSurveyExtensionList().filter { it.isSuitableToShow(project) }