Skip to content

fix(backend): use relationshipType in groupDeleteRelation error message (#16780)#16781

Open
YAMRAJ13y wants to merge 1 commit into
OpenCTI-Platform:masterfrom
YAMRAJ13y:fix/group-delete-relation-tdz
Open

fix(backend): use relationshipType in groupDeleteRelation error message (#16780)#16781
YAMRAJ13y wants to merge 1 commit into
OpenCTI-Platform:masterfrom
YAMRAJ13y:fix/group-delete-relation-tdz

Conversation

@YAMRAJ13y

Copy link
Copy Markdown

Proposed changes

groupDeleteRelation in src/domain/group.js referenced the local input variable in its validation error message before input is declared (it is a const declared ~10 lines further down). Accessing it there hits the temporal dead zone, so calling the function with a non-internal relationshipType throws ReferenceError: Cannot access 'input' before initialization instead of the intended FunctionalError with a clear message.

The fix uses the relationshipType parameter (already in scope) directly in the message — a one-line change.

Related issues

Closes #16780

How to test

Call groupDeleteRelation with a non-internal relationship type; it now returns the intended validation error (Only ... can be deleted through this method, got <type>.) instead of a ReferenceError.

…ge (OpenCTI-Platform#16780)

groupDeleteRelation referenced the local 'input' variable in the validation
error message before it is declared (it is a const declared ~10 lines later),
so a non-internal relationshipType produced a ReferenceError (temporal dead
zone) instead of the intended FunctionalError.

Use the relationshipType parameter directly in the message.

Closes OpenCTI-Platform#16780
Copilot AI review requested due to automatic review settings June 23, 2026 16:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@aHenryJard aHenryJard added the community Contribution from the community. label Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community Contribution from the community.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(backend): groupDeleteRelation throws ReferenceError instead of validation error for non-internal relationship types

3 participants