-
Notifications
You must be signed in to change notification settings - Fork 2
feat: implement live resource updates via events #84
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
base: yerek
Are you sure you want to change the base?
Conversation
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.
Pull request overview
This PR implements live resource updates via WebSocket events by integrating SWR's mutation capabilities into the event handling system. When operations complete (start, stop, etc.), the affected resources are automatically revalidated to keep the UI synchronized with backend state changes.
- Adds SWR mutation triggering based on parsed
resourcesmetadata from operation events - Implements automatic parent collection mutation using a path-based heuristic
- Enables real-time UI updates without manual refresh when operations occur
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
…/ararat-web into Mutations-Event-Handler
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.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Hye-Dev
left a comment
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.
This is not fully complete.
Ex: If I go to backups on an instance then press "delete backup", the backup does not disappear from the list until I refresh. Likewise for creating backups.
Improve backup list updates after actions
Hye-Dev
left a comment
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.
Please fix compilation errors @Luxxy-GF
Hye-Dev
left a comment
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.
Compilation errors are still present:
./app/(main)/instance/_hooks/backups.ts:55:25
Type error: Type '(current?: StandardResponse<Backup[]>) => { metadata: Backup[]; type: "sync"; status: string; status_code: StatusCode; } | undefined' is not assignable to type 'StandardResponse<Backup[]> | ((currentData: StandardResponse<Backup[]> | undefined, displayedData: StandardResponse<Backup[]> | undefined) => StandardResponse<...>) | undefined'.
Type '(current?: StandardResponse<Backup[]>) => { metadata: Backup[]; type: "sync"; status: string; status_code: StatusCode; } | undefined' is not assignable to type '(currentData: StandardResponse<Backup[]> | undefined, displayedData: StandardResponse<Backup[]> | undefined) => StandardResponse<Backup[]>'.
Type '{ metadata: Backup[]; type: "sync"; status: string; status_code: StatusCode; } | undefined' is not assignable to type 'StandardResponse<Backup[]>'.
Type 'undefined' is not assignable to type 'StandardResponse<Backup[]>'.
53 | },
54 | {
> 55 | optimisticData: removeBackup,
| ^
56 | rollbackOnError: true,
57 | revalidate: true,
58 | },
Next.js build worker exited with code: 1 and signal: null
error: script "build-dev" exited with code 1
feat: implement live resource updates via events
resourcesmetadata from operation eventsCloses #63