You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(relations): remove the correct reverse relation - #10266
Remove the correct reverse relation from the client cache when deleting a work-item relation.
For A blocking B, with B blocked by both A and C, the reverse lookup searched for B instead of A. It usually returned -1, so the subsequent splice removed C while leaving A visible. The reverse update also incorrectly depended on the forward list's index.
Look up the original issue ID and check the reverse index independently. This handles partially loaded caches and local-only removal without changing API requests or error recovery.
Type of Change
Bug fix (non-breaking change which fixes an issue)
Screenshots and Media (if applicable)
No layout changes.
Test Scenarios
Validated on preview 0b9ca512c8a841bcbe9be62e22146daa74d71edb, using Node 24.22.1, pnpm 11.25.0 (repository declares 11.10.0), and Vitest 4.1.12.
Fifteen native store tests pass with real MobX/lodash and mocked relation-service/root-store boundaries. Cases cover directional and symmetric relations, first/middle/last positions, sparse caches, unrelated relations, local-only removal and API rejection.
With current-preview production store bytes and the same regression harness, ten tests fail and five pass. Restoring the fix returns all fifteen to passing.
All 45 format/lint/typecheck tasks and 11 prerequisite builds in the repository's turbo run check --dry=json graph passed using installed native tools, preserving every executable task and dependency order. This includes all four app typechecks; full web lint reports 431 warnings and zero errors.
The standard i18n generator's tsx CLI requires an IPC socket unavailable in this environment. The same generator ran using node --import tsx scripts/generate-types.ts; manifests were not changed. This is equivalent task coverage, not a claim that the unmodified pnpm check wrapper itself ran.
The web test setup matches the setup in #10265, which covers a separate comment-draft bug. It uses dependencies already pinned in the workspace catalog; reconcile the shared setup if that PR lands first.
For a fresh checkout, use pnpm turbo run test --filter=web, whose existing task graph builds workspace prerequisites. Direct pnpm --filter web test assumes those artifacts are already built.
Full application production builds, backend/database integration, live-browser workflows and hosted CI were not run.
References
The relation-row removal, relation selector and local related-item-deletion paths call this store method. No issue is claimed closed.
Summary by CodeRabbit
Bug Fixes
Removing an issue relation now also clears the matching reverse relation from the related issue’s cached list, including when the current issue is not first in that entry.
Reverse relations are cleaned up even when the forward relation is absent, while unrelated entries are preserved.
If the removal request fails, the reverse cache remains unchanged and the forward relations are refreshed.
No actionable comments were generated in the recent review.
Walkthrough
The reverse-relation lookup now matches the current issue ID. The pull request adds tests for relation removal and configures Vitest with its test dependencies.
Changes: Issue relation removal
Layer / File(s)
Summary
Reverse-relation removal and regression coverage apps/web/store/issue/issue-details/relation.store.ts, apps/web/store/issue/issue-details/relation.store.test.ts, apps/web/vitest.config.ts, apps/web/package.json
The reverse-list lookup now matches issueId. Tests cover relation types, reverse-list positions, missing forward relations, local removal, and API failure. The web app adds Vitest configuration, a test script, and test dependencies.
Removing a work-item relation now removes the matching reverse entry instead of a different one. The added test tooling affects development only, and no merge-blocking risk remains.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "fix(relations): remove the correct reverse relation" matches the main change. The diff changes removeRelation in relation.store.ts so it looks up the original issue ID in the related issu…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description check
The description clearly states the problem, the fix, and the test scenarios, and it selects the Bug fix type. It covers the required sections of the template except Screenshots, which the author addre…
Full details: Title check
Explanation
The title "fix(relations): remove the correct reverse relation" matches the main change. The diff changes removeRelation in relation.store.ts so it looks up the original issue ID in the related issue's reverse list instead of searching for related_issue. Tests for this path were added in relation.store.test.ts. The title is specific and conveys the primary bug fix. It uses a conventional commit prefix, which is consistent with repository practice.
Full details: Description check
Explanation
The description clearly states the problem, the fix, and the test scenarios, and it selects the Bug fix type. It covers the required sections of the template except Screenshots, which the author addressed with 'No layout changes.' The References section names the affected paths but does not link an issue. The description is detailed and technically specific, so it is mostly complete.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
This branch has not been deployed
No deployments
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
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.
Description
Remove the correct reverse relation from the client cache when deleting a work-item relation.
For A blocking B, with B blocked by both A and C, the reverse lookup searched for B instead of A. It usually returned -1, so the subsequent splice removed C while leaving A visible. The reverse update also incorrectly depended on the forward list's index.
Look up the original issue ID and check the reverse index independently. This handles partially loaded caches and local-only removal without changing API requests or error recovery.
Type of Change
Screenshots and Media (if applicable)
No layout changes.
Test Scenarios
Validated on preview
0b9ca512c8a841bcbe9be62e22146daa74d71edb, using Node 24.22.1, pnpm 11.25.0 (repository declares 11.10.0), and Vitest 4.1.12.turbo run check --dry=jsongraph passed using installed native tools, preserving every executable task and dependency order. This includes all four app typechecks; full web lint reports 431 warnings and zero errors.node --import tsx scripts/generate-types.ts; manifests were not changed. This is equivalent task coverage, not a claim that the unmodifiedpnpm checkwrapper itself ran.git diff --checkpass.The web test setup matches the setup in #10265, which covers a separate comment-draft bug. It uses dependencies already pinned in the workspace catalog; reconcile the shared setup if that PR lands first.
For a fresh checkout, use
pnpm turbo run test --filter=web, whose existing task graph builds workspace prerequisites. Directpnpm --filter web testassumes those artifacts are already built.Full application production builds, backend/database integration, live-browser workflows and hosted CI were not run.
References
The relation-row removal, relation selector and local related-item-deletion paths call this store method. No issue is claimed closed.
Summary by CodeRabbit