-
Notifications
You must be signed in to change notification settings - Fork 3.3k
feat: notification store #2025
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
feat: notification store #2025
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile Summary
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Workflow
participant NotificationStore
participant NotificationsUI
participant Copilot
User->>Workflow: Attempts to add duplicate trigger block
Workflow->>NotificationStore: addNotification(error, message, action)
NotificationStore->>NotificationStore: Create notification with UUID
NotificationStore->>NotificationsUI: State update triggers re-render
NotificationsUI->>User: Display error notification with "Fix in Copilot" button
User->>NotificationsUI: Clicks "Fix in Copilot" button
NotificationsUI->>Copilot: openCopilotWithMessage(errorMessage)
Copilot->>Copilot: Switch to copilot tab
Copilot->>Copilot: Send message with instructions
NotificationsUI->>NotificationStore: removeNotification(id)
NotificationStore->>NotificationsUI: State update removes notification
|
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.
3 files reviewed, 1 comment
Edit Code Review Agent Settings | Greptile
React with 👍 or 👎 to share your feedback on this new summary format
| removedNotifications.forEach((n) => { | ||
| const timeout = state.timeouts.get(n.id) | ||
| if (timeout) { | ||
| clearTimeout(timeout) | ||
| state.timeouts.delete(n.id) | ||
| } |
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.
logic: State mutation detected in Zustand setter - state.timeouts.delete(n.id) directly mutates the state Map inside the setter callback, violating immutability principles.
| removedNotifications.forEach((n) => { | |
| const timeout = state.timeouts.get(n.id) | |
| if (timeout) { | |
| clearTimeout(timeout) | |
| state.timeouts.delete(n.id) | |
| } | |
| removedNotifications.forEach((n) => { | |
| const timeout = state.timeouts.get(n.id) | |
| if (timeout) { | |
| clearTimeout(timeout) | |
| } | |
| }) |
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/sim/stores/notifications/store.ts
Line: 89:94
Comment:
**logic:** State mutation detected in Zustand setter - `state.timeouts.delete(n.id)` directly mutates the state Map inside the setter callback, violating immutability principles.
```suggestion
removedNotifications.forEach((n) => {
const timeout = state.timeouts.get(n.id)
if (timeout) {
clearTimeout(timeout)
}
})
```
How can I resolve this? If you propose a fix, please make it concise.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.
17 files reviewed, no comments
Edit Code Review Agent Settings | Greptile
React with 👍 or 👎 to share your feedback on this new summary format
Summary
Adds a generic workflow notification store.
Type of Change
Testing
Solo testing.
Checklist