Skip to content
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

feature: prevent stacking of duplicate notifications #2502

Merged

Conversation

yomybaby
Copy link
Member

@yomybaby yomybaby commented Jul 1, 2024

TL;DR

Removed unnecessary console log statements and improved notification handling by adding a unique key parameter to avoid duplicate notifications.

What changed?

  • Removed console.log statements in backend-ai-session-list.ts and lablup-notification.ts files.
  • Enhanced the show method in LablupNotification component to include a key parameter for uniquely identifying notifications.
  • Added logic to prevent dispatching duplicate notifications and handled the 'Network disconnected' message specifically.

How to test?

  1. Trigger an error in the application and verify that console log statements no longer appear.
  2. Check that notifications are correctly displayed without duplication.
  3. Ensure the 'Network disconnected' message is handled by the NetworkStatusBanner component.

Why make this change?

To clean up the console output and improve the notification system by preventing duplicate messages and enhancing user experience.


Checklist: (if applicable)

  • Mention to the original issue
  • Documentation
  • Minium required manager version
  • Specific setting for review (eg., KB link, endpoint or how to setup)
  • Minimum requirements to check during review
  • Test case(s) to demonstrate the difference of before/after

Copy link

graphite-app bot commented Jul 1, 2024

Your org requires the Graphite merge queue for merging into main

Add the label “flow:merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “flow:hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

Copy link
Member Author

yomybaby commented Jul 1, 2024

@github-actions github-actions bot added the size:M 30~100 LoC label Jul 1, 2024
@yomybaby yomybaby marked this pull request as ready for review July 1, 2024 00:26
Copy link
Contributor

@ironAiken2 ironAiken2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In cases where individual notifications are required, such as deleting a session, stopping another session will not cause a Notifiaction if a notification has already been upserted for the terminating or already terminating session.

How to test:

  1. delete a session.
  2. Delete another session without clearing the session deletion notification.
  3. Verify that the session deletion notification does not occur.

@ironAiken2 ironAiken2 changed the base branch from feature/no-network-banner to main July 1, 2024 02:36
@yomybaby yomybaby force-pushed the feature/prevent-staking-duplicated-notifications branch from 1a491b2 to 082820c Compare July 1, 2024 02:43
Copy link
Contributor

@ironAiken2 ironAiken2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yomybaby yomybaby changed the title feature: prevent stacking of duplicate notifications Refactor Jul 1, 2024
@yomybaby yomybaby changed the title Refactor feature: prevent stacking of duplicate notifications Jul 1, 2024
Copy link

graphite-app bot commented Jul 3, 2024

Merge activity

### TL;DR

Removed unnecessary console log statements and improved notification handling by adding a unique key parameter to avoid duplicate notifications.

### What changed?

- Removed `console.log` statements in `backend-ai-session-list.ts` and `lablup-notification.ts` files.
- Enhanced the `show` method in `LablupNotification` component to include a `key` parameter for uniquely identifying notifications.
- Added logic to prevent dispatching duplicate notifications and handled the 'Network disconnected' message specifically.

### How to test?

1. Trigger an error in the application and verify that console log statements no longer appear.
2. Check that notifications are correctly displayed without duplication.
3. Ensure the 'Network disconnected' message is handled by the `NetworkStatusBanner` component.

### Why make this change?

To clean up the console output and improve the notification system by preventing duplicate messages and enhancing user experience.

---

<!--
Please precisely, concisely, and concretely describe what this PR changes, the rationale behind codes,
and how it affects the users and other developers.
-->

**Checklist:** (if applicable)

- [ ] Mention to the original issue
- [ ] Documentation
- [ ] Minium required manager version
- [ ] Specific setting for review (eg., KB link, endpoint or how to setup)
- [ ] Minimum requirements to check during review
- [ ] Test case(s) to demonstrate the difference of before/after
@yomybaby yomybaby force-pushed the feature/prevent-staking-duplicated-notifications branch from 082820c to e4145c4 Compare July 3, 2024 10:49
@graphite-app graphite-app bot merged commit e4145c4 into main Jul 3, 2024
5 checks passed
@graphite-app graphite-app bot deleted the feature/prevent-staking-duplicated-notifications branch July 3, 2024 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:M 30~100 LoC
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants