fix(workflow): invalidate directory-items query on tag add/remove success#2255
Merged
daryllimyt merged 2 commits intomainfrom Mar 4, 2026
Merged
Conversation
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced Mar 4, 2026
Contributor
There was a problem hiding this comment.
1 issue found across 3 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="tracecat/workflow/tags/service.py">
<violation number="1" location="tracecat/workflow/tags/service.py:53">
P1: The new `IntegrityError` handler is too broad: it treats all constraint failures as concurrent duplicate inserts and may raise `NoResultFound` for FK violations. Only return existing link when a row is actually found; otherwise raise a clear domain error.
(Based on your team's feedback about translating database constraint violations to explicit service-layer errors.) [FEEDBACK_USED]</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
jordan-umusu
approved these changes
Mar 4, 2026
633bcbc to
51c315b
Compare
Contributor
Author
Merge activity
|
8de619a to
5af6831
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.

Checklist
uv run pytest tests)?pre-commit run --all-files)?Description
This PR makes workflow tag add/remove updates reflect immediately in the directory view and simplifies workflow-tag link writes under concurrency.
directory-itemsandworkflowsqueries after successful workflow tag add/remove mutations.IntegrityErrorconflict handling inadd_workflow_tagwith PostgreSQL upsert (ON CONFLICT DO NOTHING) plus fallback fetch.add_workflow_tagremains idempotent and race-safe, without exception-driven flow for normal duplicate inserts.Related Issues
Screenshots / Recordings
Steps to QA
uv run ruff check tracecat/workflow/tags/service.pyuv run basedpyright tracecat/workflow/tags/service.pyTRACECAT__SERVICE_KEY=test-service-key uv run pytest tests/unit/test_tags_service.py -k "TestWorkflowTagsService" -qSummary by cubic
Invalidate the directory-items query on tag add/remove so the directory view updates immediately. Switch workflow tag linking to a Postgres upsert for idempotent, race-safe inserts.
Bug Fixes
Refactors
Written for commit 5af6831. Summary will update on new commits.