Repository navigation
Notification Provider Bug Fixes 20260415
Paulo Gomes da Cruz Junior edited this page Apr 16, 2026
·
1 revision
Follow-up bug fixes to the notification event system refactor. The changes
address three specific issues: memory leaks from missing cleanup function
returns in useEffect, incorrect CSS class application preventing slide-out
animations from completing, and improper error object serialization in service
worker registration error handling.
- #764
- Eliminate memory leaks caused by unregistered notification event dispatchers on component unmount
- Restore correct slide-out animation behavior for notifications
- Ensure notification queue removal does not interrupt in-progress animations
- Provide meaningful error messages when service worker registration fails
- Fixed
useEffectcleanup pattern:registerNotificationEventDispatchernow properly returns the unregister function - Added new
useEffecthook to manage async queue removal: decouples animation completion from queue state updates
- Eliminated memory leak from missing event dispatcher unregistration on
NotificationProviderunmount - Improved garbage collection: proper cleanup of timer references prevents memory accumulation
None.
- Fixed notification slide-out animation: now applies
slide-outclass immediately instead ofslide-in - Added 300ms delay before removing notification from queue: ensures animation completes before component unmounts
- Removed inline queue removal from
onClosehandler: moved to separateuseEffectfor better separation of concerns
- Memory leak in
NotificationProvider: unregister function not being called on unmount - Animation cut-off bug: setting
slide-ininstead ofslide-outprevented slide-out animation from triggering - Premature queue removal: notification removed immediately, interrupting the 300ms slide-out animation
- Error serialization in
registerServiceWorker:JSON.stringify(error)produced empty objects for nativeErrorinstances
- Eliminates memory leaks from event dispatcher not being properly unregistered
- Ensures notification animations complete smoothly before component removal
- Improves user experience with consistent, uninterrupted notification slide-out behavior
- Provides meaningful error messages to users when service worker registration fails
- Verify notification queue removal timing works correctly across different browser speeds
- Consider making the 300ms delay configurable if animation duration changes
- Test error handling in service worker registration across different failure scenarios
- Add integration tests to verify animation timing and queue removal behavior
This wiki documents NR Waste Plus for users and developers. Verify security and deployment guidance against the current application configuration before applying it elsewhere.
- Report an issue or ask a question in the GitHub repository.
- Follow the Contributing Guidelines to propose an update.
- Read the Code of Conduct.
Collection indexes support human browsing and machine retrieval. Keep both current when adding or moving wiki pages.
NR Waste Plus Wiki | GitHub Repository