Skip to content

fix(ui): refresh issue properties watchdog state immediately after changes (#8789) - #11092

Open
wakqasahmed wants to merge 2 commits into
paperclipai:masterfrom
wakqasahmed:fix/issue-watchdog-cache-refresh-8789
Open

fix(ui): refresh issue properties watchdog state immediately after changes (#8789)#11092
wakqasahmed wants to merge 2 commits into
paperclipai:masterfrom
wakqasahmed:fix/issue-watchdog-cache-refresh-8789

Conversation

@wakqasahmed

Copy link
Copy Markdown

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

  1. Properties Panel Key (ui/src/lib/issue-properties-panel-key.ts):
    • Added updatedAt timestamp from the serialized watchdog object to buildIssuePropertiesPanelKey so issuePanelKey invalidates and re-calculates when watchdog state mutates.
  2. Issue Properties Component (ui/src/components/issue-properties/IssueProperties.tsx):
    • Updated upsertWatchdog and deleteWatchdog success handlers to iterate through all cache references (getIssueDetailCacheRefs(issue), covering both issue ID and issue identifier keys).
    • Immediately updated query cache data, invalidated query keys (queryKeys.issues.detail(ref)), and synchronized local input states (setWatchdogAgentInput & setWatchdogInstructionsInput).
    • Updated useEffect dependency array for watchdog inputs re-sync to include issue.watchdog?.status and issue.watchdog?.id.
  3. Unit Tests (ui/src/components/IssueProperties.test.tsx):
    • Updated unit tests for watchdog save and removal to verify cache updates and invalidation across both issue.id and issue.identifier query keys.

@commitperclip

commitperclip Bot commented Aug 8, 2026

Copy link
Copy Markdown

Hey @wakqasahmed! Before this PR can be reviewed, a few things need attention:

Missing or incomplete:

  • Missing section: ## Thinking Path
  • Missing section: ## What Changed
  • Missing section: ## Verification
  • Missing section: ## Risks
  • Missing section: ## Model Used
  • Add the dedup-search checkbox to your PR description and check it once you have searched the GitHub PR list for similar PRs. See the PR template at .github/PULL_REQUEST_TEMPLATE.md and CONTRIBUTING.md → "Before You Start: Search First".

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refresh issue properties watchdog state immediately after changes

1 participant