Commit 35ef8b7
committed
fix(relations): only set targetProjectSlug for genuine cross-project edges
The previous commit always populated targetProjectSlug from the
target's project_id, but for workspace projects the source-side
StoreManager is bound to the synthetic workspace-root project (e.g.
slug 'backend'), and that root is not exposed as a navigable project
in the multi-config — only its real members like 'api-gateway' and
'catalog-service' are. So workspace-shared knowledge → knowledge edges
were emitting targetProjectSlug='backend', the UI tried to navigate
to /ui/backend/knowledge/X, and the REST layer rejected it with
"Project 'backend' not found".
Fix: skip resolution when targetProjectId equals the current scoped
project. The UI then falls back to whichever real project is already
in the URL. Cross-project resolution only kicks in when the target
genuinely lives in a different project (workspace knowledge → code/
docs/files in a specific subproject).
Verified end-to-end against the real demo workspace database:
Note 25 (workspace knowledge):
out implemented_in → code "rate-limiter.ts" project: api-gateway
out documented_in → docs "Rate Limiting" project: api-gateway
in relates_to → knowledge "API Versioning Strategy" project: (current)
in implements → tasks "..." project: (current)
Note 28:
out implemented_in → code "search-service.ts" project: catalog-service
out documented_in → docs "Search Algorithm" project: catalog-service
out depends_on → knowledge "..." project: (current)1 parent 163db54 commit 35ef8b7
2 files changed
Lines changed: 26 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
584 | 584 | | |
585 | 585 | | |
586 | 586 | | |
587 | | - | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
588 | 596 | | |
589 | | - | |
590 | | - | |
| 597 | + | |
| 598 | + | |
591 | 599 | | |
592 | 600 | | |
593 | 601 | | |
| |||
597 | 605 | | |
598 | 606 | | |
599 | 607 | | |
600 | | - | |
| 608 | + | |
601 | 609 | | |
602 | 610 | | |
603 | 611 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
605 | 605 | | |
606 | 606 | | |
607 | 607 | | |
608 | | - | |
609 | | - | |
610 | | - | |
611 | | - | |
612 | | - | |
613 | | - | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
614 | 615 | | |
615 | | - | |
616 | | - | |
617 | | - | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
618 | 619 | | |
619 | 620 | | |
620 | | - | |
621 | | - | |
| 621 | + | |
| 622 | + | |
622 | 623 | | |
623 | 624 | | |
624 | 625 | | |
625 | 626 | | |
626 | | - | |
627 | | - | |
628 | | - | |
| 627 | + | |
| 628 | + | |
629 | 629 | | |
630 | 630 | | |
631 | 631 | | |
| |||
0 commit comments