fix(ui): refresh issue properties watchdog state immediately after changes (#8789) - #11092
Open
wakqasahmed wants to merge 2 commits into
Open
fix(ui): refresh issue properties watchdog state immediately after changes (#8789)#11092wakqasahmed wants to merge 2 commits into
wakqasahmed wants to merge 2 commits into
Conversation
|
Hey @wakqasahmed! Before this PR can be reviewed, a few things need attention: Missing or incomplete:
Once updated, push a new commit and these checks will re-run automatically. — commitperclip |
- Add a test proving a failed upsertWatchdog mutation leaves the issue.id and issue.identifier detail caches untouched (no false "watching" state) and surfaces the error inline, since the mutation has no optimistic update to roll back. - Add a panel-key regression test proving buildIssuePropertiesPanelKey changes when only watchdog.updatedAt changes (all other watchdog fields held constant), covering the new updatedAt inclusion added in this fix. Reviewed the full diff for missing invalidation paths, optimistic update rollback races, and debounce concerns: upsertWatchdog/ deleteWatchdog are the only mutation paths touching issue.watchdog, both already refresh every issue.id/identifier cache ref via getIssueDetailCacheRefs, and neither uses an optimistic update, so no rollback bug exists. No production code changes were needed.
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.
Fixes #8789
Summary
The Issue Properties pane previously retained stale task watchdog state after setting, updating, or deleting a watchdog because the issue detail query cache and panel rendering key did not immediately sync upon watchdog mutation.
Fix
ui/src/lib/issue-properties-panel-key.ts):updatedAttimestamp from the serialized watchdog object tobuildIssuePropertiesPanelKeysoissuePanelKeyinvalidates and re-calculates when watchdog state mutates.ui/src/components/issue-properties/IssueProperties.tsx):upsertWatchdoganddeleteWatchdogsuccess handlers to iterate through all cache references (getIssueDetailCacheRefs(issue), covering both issue ID and issue identifier keys).queryKeys.issues.detail(ref)), and synchronized local input states (setWatchdogAgentInput&setWatchdogInstructionsInput).useEffectdependency array for watchdog inputs re-sync to includeissue.watchdog?.statusandissue.watchdog?.id.ui/src/components/IssueProperties.test.tsx):issue.idandissue.identifierquery keys.