Skip to content

Conversation

Corepex
Copy link
Contributor

@Corepex Corepex commented Oct 15, 2025

Changes in this pull request

Resolves #2236

Additional info

This pull request refactors the notification tag handling and improves the notification deletion flow, especially for optimistic updates and cache consistency. The main changes involve updating how tags are provided and invalidated for notifications, and ensuring that deleting a notification immediately updates the UI by removing it from cached collections.

Tag handling and cache management improvements:

  • Updated the providingTags and invalidatingTags structures in tags.ts to use NOTIFICATIONS and NOTIFICATION_DETAIL consistently, removing the old NOTIFICATION tag and aligning tag usage for better cache management. [1] [2]
  • Adjusted notifications-slice-enhanced.ts to use the new tag functions, ensuring that notification collections and details are properly tagged for cache updates.

Optimistic UI and error handling enhancements:

  • Added a new removeNotificationFromCollectionById method to use-optimistic-update.tsx, which updates cached notification collections to immediately reflect deletions, improving perceived performance and user experience. [1] [2]
  • Refactored use-notification-detail.tsx to use the new removal method and improved error handling by distinguishing between API and general errors during deletion. [1] [2] [3]

Minor UI code cleanup:

  • Cleaned up state initialization and effect usage in notification-detail.tsx to align with the new notification detail hook structure. [1] [2]

@Corepex Corepex self-assigned this Oct 15, 2025
Copy link

sonarqubecloud bot commented Oct 15, 2025

Quality Gate Passed Quality Gate passed

Issues
0 New issues
1 Accepted issue

Measures
0 Security Hotspots
No data about Coverage
28.4% Duplication on New Code

See analysis details on SonarQube Cloud

@Corepex Corepex requested a review from xIrusux October 15, 2025 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Notifications] deletion requires browser refresh

1 participant