Skip to content

fix: invalidate notification.one query cache on update#3967

Merged
Siumauricio merged 1 commit intoDokploy:canaryfrom
desen94:fix/invalidate-notification-cache-on-edit
Mar 10, 2026
Merged

fix: invalidate notification.one query cache on update#3967
Siumauricio merged 1 commit intoDokploy:canaryfrom
desen94:fix/invalidate-notification-cache-on-edit

Conversation

@desen94
Copy link

@desen94 desen94 commented Mar 10, 2026

What is this PR about?

When editing a notification and saving changes, only the notification.all query cache was invalidated. The notification.one query retained stale cached data, causing the edit form to display previous values when clicking "Edit" again on the same notification.

This fix adds notification.one cache invalidation after a successful update, ensuring the form always reflects the latest saved data.

Checklist

Before submitting this PR, please make sure that:

  • You created a dedicated branch based on the canary branch.
  • You have read the suggestions in the CONTRIBUTING.md file https://github.com/Dokploy/dokploy/blob/canary/CONTRIBUTING.md#pull-request
  • You have tested this PR in your local instance. If you have not tested it yet, please do so before submitting. This helps avoid wasting maintainers' time reviewing code that has not been verified by you.

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.all was being invalidated, leaving notification.one with stale data and causing the edit form to show old values on subsequent opens. The fix adds a notification.one invalidation call guarded by a notificationId check inside the shared success handler.

  • The logic is correct and minimal — all update mutation paths funnel into the same .then() block, so every update type now benefits from the fix.
  • The notificationId guard is appropriate since notification.one only applies to existing notifications.
  • The three new lines use spaces while the rest of the file uses tabs for indentation — a minor style inconsistency worth tidying up.

Confidence Score: 5/5

  • This PR is safe to merge; the change is small, targeted, and logically correct.
  • The fix is a single, well-scoped addition that correctly invalidates the notification.one query cache on update. No risk of regressions — the new call is guarded by the existing notificationId check and sits in the success path only. The only finding is a trivial indentation inconsistency.
  • No files require special attention.

Last reviewed commit: d95b4dc

Greptile also left 1 inline comment on this PR.

(2/5) Greptile learns from your feedback when you react with thumbs up/down!

@desen94 desen94 requested a review from Siumauricio as a code owner March 10, 2026 18:12
@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. bug Something isn't working labels Mar 10, 2026
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.
@desen94 desen94 force-pushed the fix/invalidate-notification-cache-on-edit branch from d95b4dc to 1c0dbbc Compare March 10, 2026 18:17
@Siumauricio Siumauricio merged commit c9a9ed8 into Dokploy:canary Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants