diff --git a/plugins/kotlin/onboarding/src/org/jetbrains/kotlin/onboarding/k2/satisfaction/survey/K2FeedbackSurveyConfig.kt b/plugins/kotlin/onboarding/src/org/jetbrains/kotlin/onboarding/k2/satisfaction/survey/K2FeedbackSurveyConfig.kt index c5436dfa55fa..47f76e318050 100644 --- a/plugins/kotlin/onboarding/src/org/jetbrains/kotlin/onboarding/k2/satisfaction/survey/K2FeedbackSurveyConfig.kt +++ b/plugins/kotlin/onboarding/src/org/jetbrains/kotlin/onboarding/k2/satisfaction/survey/K2FeedbackSurveyConfig.kt @@ -16,7 +16,7 @@ import org.jetbrains.kotlin.onboarding.FeedbackNotificationWithKotlinLogo class K2FeedbackSurveyConfig : InIdeFeedbackSurveyConfig { override val surveyId: String = "k2_feedback" - override val lastDayOfFeedbackCollection: LocalDate = LocalDate(2025, 4, 1) + override val lastDayOfFeedbackCollection: LocalDate = LocalDate(2026, 1, 1) override val requireIdeEAP: Boolean = false private val suitableIdeVersion: String = Registry.stringValue("k2.feedback.survey.ide.version.number") diff --git a/plugins/kotlin/onboarding/src/org/jetbrains/kotlin/onboarding/k2/satisfaction/survey/K2UserTracker.kt b/plugins/kotlin/onboarding/src/org/jetbrains/kotlin/onboarding/k2/satisfaction/survey/K2UserTracker.kt index 197c831ad863..646cc0851e4a 100644 --- a/plugins/kotlin/onboarding/src/org/jetbrains/kotlin/onboarding/k2/satisfaction/survey/K2UserTracker.kt +++ b/plugins/kotlin/onboarding/src/org/jetbrains/kotlin/onboarding/k2/satisfaction/survey/K2UserTracker.kt @@ -12,7 +12,6 @@ import org.jetbrains.kotlin.idea.base.plugin.KotlinPluginMode import org.jetbrains.kotlin.idea.base.plugin.KotlinPluginModeProvider import org.jetbrains.kotlin.idea.base.util.containsNonScriptKotlinFile import org.jetbrains.kotlin.idea.base.util.runReadActionInSmartMode -import java.time.Duration import java.time.Instant internal const val K2_SINCE_NOT_DEFINED = -1L @@ -99,30 +98,6 @@ class K2UserTracker : PersistentStateComponent { } if (!projectContainsNonScriptKotlinFile) return false - if (switchedToK1) { - return true - } else { - val k2Chosen = if (forUnitTests) { - k2PluginModeForTests - } else { - KotlinPluginModeProvider.currentPluginMode == KotlinPluginMode.K2 - } - if (!k2Chosen) { - LOG.debug("Not showing the K2 feedback dialog because the user doesn't use K2") - return false - } else { - // The following condition is needed if a user had always been on K2 even before the survey started - if (state.k2UserSince == K2_SINCE_NOT_DEFINED) { - state.k2UserSince = Instant.now().epochSecond - } - val k2UserSince = Instant.ofEpochSecond(state.k2UserSince) // k2UserSince might be initialized here on the first access - val durationSinceK2User = Duration.between(k2UserSince, Instant.now()) - - LOG.debug("Duration since user became a K2 Kotlin user: ${durationSinceK2User.toDays()} day(s)") - return durationSinceK2User > Duration.ofSeconds( - Registry.intValue("minimum.usage.time.before.showing.k2.survey").toLong() - ) - } - } + return switchedToK1 } } \ No newline at end of file diff --git a/plugins/kotlin/onboarding/test/onboarding/k2/satisfaction/survey/K2UserTrackerTest.kt b/plugins/kotlin/onboarding/test/onboarding/k2/satisfaction/survey/K2UserTrackerTest.kt index d20810e736fc..a909299cf334 100644 --- a/plugins/kotlin/onboarding/test/onboarding/k2/satisfaction/survey/K2UserTrackerTest.kt +++ b/plugins/kotlin/onboarding/test/onboarding/k2/satisfaction/survey/K2UserTrackerTest.kt @@ -61,7 +61,7 @@ class K2UserTrackerTest: LightJavaCodeInsightFixtureTestCase() { assertFalse(instance.state.userSawSurvey) } - fun `test show dialog if more than one day on K2`() { + fun `test do not show dialog if more than one day on K2 and still on K2`() { val instance = createInstance() instance.state.k2UserSince = Instant.now().epochSecond.minus(346000) // They've been on K2 for 4+ days 4 * 24 * 60 * 60 + 400 instance.state.lastSavedPluginMode = PluginModes.K2.value @@ -69,6 +69,6 @@ class K2UserTrackerTest: LightJavaCodeInsightFixtureTestCase() { assertFalse(instance.state.userSawSurvey) - assertTrue(instance.shouldShowK2FeedbackDialog(project)) + assertFalse(instance.shouldShowK2FeedbackDialog(project)) } } \ No newline at end of file