Skip to content

Commit 46c4a3c

Browse files
samgst-amazonaws-toolkit-automationmanodnyabbryceitoc9
authored
Fix notification polling race condition (#5142)
* Add framework for processing notifications (#5112) * Add deserialization for notification messages retrieved from the notification file and criteria on whether it should be displayed (#5093) * Display toast notifications with actions * Condition matcher for displaying notifications * Modified deserialization cases and added tests * not required file change * feedback 1 * modified the base class * modified test instance lifecycle * Show toasts for notifications and notification banner on critical notifications(#5097) * Display toast notifications with actions * Condition matcher for displaying notifications * Show notification banner * feedback 1 * Modified deserialization cases and added tests * not required file change * feedback 1 * feedback 1 * modified the base class * merge conflicts resolved * rearranged call site * show notifications when panel is opened * fixed tests * detekt * feedback * convert panels into wrappers * fixed test * Adding update/restart action to notifications (#5136) * Poll for new notifications (#5119) * initial commit * run on startup * detekt * move vals * remote resource implementation * comments * detekt * Validate file before saving * cache path * observer implementation * deserialize notifs from file * detekt * remove unused interface * internal class * Fix observer * etag singleton state component * add telemetry * atomicBoolean * initialize once per IDE startup * code scan * Omit (Unit) * specify etag storage location * detekt * fix detekt issues * basic tests * no star imports * coroutine scope delay instead of thread.sleep * feedback fixes * test fix * Application Exists for tests * endpoint object * detekt * detekt fixes * boolean flag * boolean flag * update tests * move startup flag handling to processBase * fix delay * fix delay * Notification dismissal state tracking (#5129) * split notifications into separated lists. * add persistent notification dismissal state logic * boolean changes * group persistant states * comments * Service initialized automatically * isStartup global * Deserialized notification schedule type * tests * persistent state syntax * convert to light services * Remove state from companion object * detekt * endpoint as registryKey * detekt * fix startup issues * Expiry issues * Add logging info to IDE notification polling and processing (#5138) * add logs for polling and processing notifs * redundant * finish log * show message instead of yesNoDialogue * initialize ProcessNotificationsBase listener before Polling service * fix isFirstPoll not setting to false on first pass --------- Co-authored-by: aws-toolkit-automation <43144436+aws-toolkit-automation@users.noreply.github.com> Co-authored-by: manodnyab <66754471+manodnyab@users.noreply.github.com> Co-authored-by: Bryce Ito <bryceito@amazon.com>
1 parent 1a5f1c9 commit 46c4a3c

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/notifications/CustomizeNotificationsUi.kt

+1-3
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,10 @@ object NotificationManager {
5959
add(
6060
NotificationActionList(AwsCoreBundle.message("general.more_dialog")) {
6161
if (url == null) {
62-
Messages.showYesNoDialog(
62+
Messages.showMessageDialog(
6363
project,
6464
message,
6565
title,
66-
AwsCoreBundle.message("general.acknowledge"),
67-
AwsCoreBundle.message("general.cancel"),
6866
AllIcons.General.Error
6967
)
7068
} else {

plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/notifications/NotificationServiceInitializer.kt

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ internal class NotificationServiceInitializer : ProjectActivity {
1313
private val initialized = AtomicBoolean(false)
1414

1515
override suspend fun execute(project: Project) {
16+
ProcessNotificationsBase.getInstance(project)
1617
if (ApplicationManager.getApplication().isUnitTestMode) return
1718
if (initialized.compareAndSet(false, true)) {
1819
val service = NotificationPollingService.getInstance()

plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/notifications/ProcessNotificationsBase.kt

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class ProcessNotificationsBase(
3131
) {
3232
private val notifListener = mutableListOf<NotifListener>()
3333
init {
34+
LOG.info { "Initializing ProcessNotificationsBase" }
3435
NotificationPollingService.getInstance().addObserver {
3536
retrieveStartupAndEmergencyNotifications()
3637
}

0 commit comments

Comments
 (0)