Skip to content

fix: normalize space id in SpaceCategoryPlugin so category links apply to spaces - EXO-88506 - #5900

Merged
Jihed525 merged 1 commit into
developfrom
backport/EXO-88506-space-category-id-normalization
Jul 20, 2026
Merged

fix: normalize space id in SpaceCategoryPlugin so category links apply to spaces - EXO-88506#5900
Jihed525 merged 1 commit into
developfrom
backport/EXO-88506-space-category-id-normalization

Conversation

@Jihed525

Copy link
Copy Markdown
Contributor

What

Backport of #5895 onto develop.

Overrides CategoryPlugin.getObject() in SpaceCategoryPlugin to normalize the technical id / identity id / pretty name to the canonical String.valueOf(space.getSpaceId()), so space category links written via non-technical ids (e.g. MCP calls) are correctly reflected in space.getCategoryIds(). Unresolvable ids are returned unchanged rather than silently corrupted.

Note: source PR #5895 is still open upstream (not yet merged into feature/ai-contribution); this backport is being pushed to develop at the requester's explicit direction, in parallel with mcp-server #16 and content #838, which all address the same category-MCP-tools ticket (EXO-88506).

Backport notes

Cherry-picked commit 70db850e0b411aa2261726e6de437bd5e8012769 cleanly onto develop, no conflicts.

Test

  • mvn -pl component/core -am -Dcheckstyle.skip=true -DskipTests install → BUILD SUCCESS
  • mvn -pl component/core -Dcheckstyle.skip=true -Dtest=SpaceCategoryPluginUnitTest,CategoryLinkServiceTest test → 8 tests, 0 failures/errors

🤖 Generated with Claude Code

…y to spaces - EXO-88506

Category links are generic metadata keyed on (objectType, objectId), but the
space UI/REST reads a denormalized space.getCategoryIds() kept in sync only by
CategoryLinkModifiedListener, whose SPACE branch resolves the space via
spaceService.getSpaceById(object.getId()) and therefore requires the space
technical id. SpaceCategoryPlugin did not override getObject(), so when a caller
(e.g. the MCP tooling) passed the space identity id or its pretty name, the raw
link was written/read-back under that id (false success) while the listener
resolved the wrong space or null, leaving space.categoryIds untouched and the UI
empty.

Override CategoryPlugin.getObject() to normalize any incoming space id form
(technical id, social Identity id or pretty name) to the canonical technical id
String.valueOf(space.getSpaceId()). Since link()/getLinkedIds() and the listener
all funnel through getObject(), the write, the read-back and the denormalization
now agree regardless of which id was supplied. Unresolvable ids are returned
unchanged rather than silently corrupted.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
(cherry picked from commit 70db850)
@Jihed525
Jihed525 requested a review from ahamdi July 20, 2026 13:44
@sonarqubecloud

Copy link
Copy Markdown

@Jihed525
Jihed525 merged commit 3659e10 into develop Jul 20, 2026
11 checks passed
@Jihed525
Jihed525 deleted the backport/EXO-88506-space-category-id-normalization branch July 20, 2026 16:36
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.

2 participants