Repository navigation
fix(admin): Mark Irrelevant feedback action fails with 404 (#3080) - #3100
Merged
Merged
Conversation
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.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #3080.
Problem
Clicking Mark Irrelevant (or Unmark Irrelevant) on a tutorial feedback entry consistently returned
404 "Feedback entry not found".Root cause
markFeedbackIrrelevant/unmarkFeedbackIrrelevantare bound toTutorialFeedback, but the admin UI renders their buttons inside thefeedbackItemsLineItem on a Tutorials object page. The UI therefore invokes them through the navigation path:With a navigation path, CAP populates
req.paramswith the keys of every segment:[tutorialKey, feedbackKey]. The handler readreq.params[0]?.ID— the tutorial key — soSELECT … WHERE ID = <tutorialID>never matched a feedback row → 404 every time.The existing unit tests only exercised the direct single-key path (
TutorialFeedback(id)/…), wherereq.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.paramsentry. This is correct for both the direct path (1 key) and the navigation path (2 keys).Tests
Added navigation-path regression tests for both
markFeedbackIrrelevantandunmarkFeedbackIrrelevantthat reproduce the exactTutorials(...)/feedbackItems(...)/actioninvocation from the UI. Confirmed they fail (404) before the fix and pass after. Fulltutorial-feedback.test.jssuite: 16/16 passing.