Skip to content

fix(admin): Mark Irrelevant feedback action fails with 404 (#3080) - #3100

Merged
jung-thomas merged 5 commits into
DEVfrom
worktree-fix-3080-feedback-irrelevant
Nov 11, 2026
Merged

jung-thomas merged 5 commits into
DEVfrom
worktree-fix-3080-feedback-irrelevant

Conversation

@jung-thomas

Copy link
Copy Markdown
Contributor

Fixes #3080.

Problem

Clicking Mark Irrelevant (or Unmark Irrelevant) on a tutorial feedback entry consistently returned 404 "Feedback entry not found".

Root cause

markFeedbackIrrelevant / unmarkFeedbackIrrelevant are bound to TutorialFeedback, but the admin UI renders their buttons inside the feedbackItems LineItem on a Tutorials object page. The UI therefore invokes them through the navigation path:

Tutorials(ID=…,IsActiveEntity=false)/feedbackItems(<feedbackID>)/AdminService.markFeedbackIrrelevant

With a navigation path, CAP populates req.params with the keys of every segment: [tutorialKey, feedbackKey]. The handler read req.params[0]?.ID — the tutorial key — so SELECT … WHERE ID = <tutorialID> never matched a feedback row → 404 every time.

The existing unit tests only exercised the direct single-key path (TutorialFeedback(id)/…), where req.params[0] happens to be the feedback key, so the bug slipped through.

Fix

Resolve the bound entity's own key from the last req.params entry. This is correct for both the direct path (1 key) and the navigation path (2 keys).

Tests

Added navigation-path regression tests for both markFeedbackIrrelevant and unmarkFeedbackIrrelevant that reproduce the exact Tutorials(...)/feedbackItems(...)/action invocation from the UI. Confirmed they fail (404) before the fix and pass after. Full tutorial-feedback.test.js suite: 16/16 passing.

release: promote directive-demo fixes (#3081, #3082) to PROD
release: promote u1 rich-media/walkthrough JS fix (#3085) to PROD
Release 1.44.0: DEV to main promotion
Promote directive-demo fixes to main (7 broken demos → all verified on DEV)
…eedbackIrrelevant (#3080)

The markFeedbackIrrelevant / unmarkFeedbackIrrelevant actions are bound to
TutorialFeedback, but the admin UI renders their buttons inside the
feedbackItems LineItem on a Tutorials object page. That invokes them through
the navigation path Tutorials(...)/feedbackItems(<id>)/markFeedbackIrrelevant,
so req.params is [tutorialKey, feedbackKey]. The handler read req.params[0]
(the tutorial key), so the feedback lookup never matched -> consistent
'Feedback entry not found' 404.

Resolve the bound entity's own key from the LAST req.params entry, which
works for both the direct single-key path and the two-key navigation path.
Add regression tests covering the navigation-path invocation for both
actions.
@jung-thomas
jung-thomas merged commit b1671de into DEV Nov 11, 2026
5 checks passed
@jung-thomas
jung-thomas deleted the worktree-fix-3080-feedback-irrelevant branch November 11, 2026 17:57
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.

1 participant