Skip to content

Resolve #108: Error & Toast Notification System#122

Merged
SudiptaPaul-31 merged 8 commits into
Lumina-eX:mainfrom
Nacho1499:feat/Error-Toast-Notification-System
Apr 26, 2026
Merged

Resolve #108: Error & Toast Notification System#122
SudiptaPaul-31 merged 8 commits into
Lumina-eX:mainfrom
Nacho1499:feat/Error-Toast-Notification-System

Conversation

@Nacho1499
Copy link
Copy Markdown
Contributor

closes #108

PR Description:
This PR implements the centralized Error & Toast Notification system as defined in Issue #108. The goal was to replace raw technical errors with a consistent, user-friendly feedback loop across the application.

Changes implemented:

  1. Centralized Error Firewall: Created handleAppError in src/lib/error-handler.ts to map technical exceptions to the three core failure cases required:
    .Wallet not connected: Handled during authentication and message sending.
    .Message send failed: Integrated into the WebSocket logic (includes rate-limit feedback).
    .Network error: Handled via global onLine checks and WebSocket handshake failures.
  2. Toast Synchronization: Configured react-hot-toast to ensure notifications appear in a consistent UI state across the app.
  3. Technical Sanitization: Updated ConnectWallet.tsx and WebSocketClient.ts to prevent technical jargon (e.g., [object Event]) from reaching the UI while logging full details to the console for debugging.

Acceptance Criteria Verification:
[x] Toast notifications appear at top-right: Verified via global Toaster configuration.
[x] Consistent UI: All error triggers now route through a single utility.
[x] Wallet not connected: Handled in both the Connection flow and Messaging flow.
[x] Message send failed: Server-side errors and rate-limits are captured.
[x] Network error: Handled during initial socket connection and unexpected drops.

Testing Instructions:
-Wallet Flow: Open the wallet modal and reject the signature. Verify the "Wallet connection rejected" toast appears.
-Messaging Flow: Try to send a message while disconnected from the internet. Verify the "Network error" toast appears.
-Spam Protection: Send messages rapidly to trigger the rate limiter. Verify the toast displays the specific "Please wait X seconds" message.

@Nacho1499
Copy link
Copy Markdown
Contributor Author

em4 em3 em2 em1

@SudiptaPaul-31
Copy link
Copy Markdown
Collaborator

@Nacho1499 please resolve the conflicts

@Nacho1499
Copy link
Copy Markdown
Contributor Author

conflict resolved

@SudiptaPaul-31
Copy link
Copy Markdown
Collaborator

@Nacho1499 build still failing

- Add markAsDelivered method to WebSocketClient class
- Expose markAsDelivered from useWebSocketSend hook
- Resolves job 72926850335
@Nacho1499
Copy link
Copy Markdown
Contributor Author

CI issue resolved. thanks

@SudiptaPaul-31 SudiptaPaul-31 merged commit b5e5766 into Lumina-eX:main Apr 26, 2026
1 check passed
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.

Error & Toast Notification System

2 participants