fix: invalidate notification.one query cache on update#3967
Merged
Siumauricio merged 1 commit intoDokploy:canaryfrom Mar 10, 2026
Merged
Conversation
apps/dokploy/components/dashboard/settings/notifications/handle-notifications.tsx
Outdated
Show resolved
Hide resolved
When editing a notification, only the notification.all query cache was invalidated. The notification.one query retained stale data, causing the edit form to display previous values on subsequent edits.
d95b4dc to
1c0dbbc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is this PR about?
When editing a notification and saving changes, only the
notification.allquery cache was invalidated. Thenotification.onequery retained stale cached data, causing the edit form to display previous values when clicking "Edit" again on the same notification.This fix adds
notification.onecache invalidation after a successful update, ensuring the form always reflects the latest saved data.Checklist
Before submitting this PR, please make sure that:
canarybranch.Issues related (if applicable)
N/A
Screenshots (if applicable)
N/A
Greptile Summary
This PR fixes a stale-cache bug in the notification edit flow: after saving an update, only
notification.allwas being invalidated, leavingnotification.onewith stale data and causing the edit form to show old values on subsequent opens. The fix adds anotification.oneinvalidation call guarded by anotificationIdcheck inside the shared success handler..then()block, so every update type now benefits from the fix.notificationIdguard is appropriate sincenotification.oneonly applies to existing notifications.Confidence Score: 5/5
notification.onequery cache on update. No risk of regressions — the new call is guarded by the existingnotificationIdcheck and sits in the success path only. The only finding is a trivial indentation inconsistency.Last reviewed commit: d95b4dc
(2/5) Greptile learns from your feedback when you react with thumbs up/down!