-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set expiry for dismissed notifications #5186
base: main
Are you sure you want to change the base?
Conversation
Qodana Community for JVMIt seems all right 👌 No new problems were found according to the checks applied 💡 Qodana analysis was run in the pull request mode: only the changed files were checked Contact Qodana teamContact us at [email protected]
|
} | ||
|
||
data class DismissedNotification( | ||
@Attribute |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are the attribute tags required here?
) | ||
|
||
data class NotificationDismissalConfiguration( | ||
@Property |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this tag required?
|
||
data class NotificationDismissalConfiguration( | ||
@Property | ||
var dismissedNotifications: MutableSet<DismissedNotification> = mutableSetOf(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var dismissedNotifications: MutableSet<DismissedNotification> = mutableSetOf(), | |
val dismissedNotifications: MutableSet<DismissedNotification> = mutableSetOf(), |
|
||
override fun getState(): NotificationDismissalConfiguration = state | ||
|
||
override fun loadState(state: NotificationDismissalConfiguration) { | ||
this.state.dismissedNotificationIds.clear() | ||
this.state.dismissedNotificationIds.addAll(state.dismissedNotificationIds) | ||
this.state.dismissedNotifications.clear() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to clear the set? Wont each value anyway be unique since it's a set?
Types of changes
Description
We store the list of dismissed notif ids in aws.xml, but we need to limit the size of this saved list.
To do this, dismissed notification IDs stored in the aws.xml are timestamped. Each time the persistent state component is loaded, any notifications older than 60 days will be removed from the set.
Checklist
License
I confirm that my contribution is made under the terms of the Apache 2.0 license.