fix(event-log): require segment boundary after 'embedded' in route regex#42011
Closed
luizotavio32 wants to merge 1 commit into
Closed
fix(event-log): require segment boundary after 'embedded' in route regex#42011luizotavio32 wants to merge 1 commit into
luizotavio32 wants to merge 1 commit into
Conversation
The optional trailing slash allowed the first branch to match prefixes like `/dashboard/123/embeddedXYZ`, misclassifying them as embedded. Require an end-of-segment boundary (`/`, `?`, `#`, or end of string) after `embedded` and add test coverage. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
|
Bito Automatic Review Skipped - Branch Excluded |
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
SUMMARY
Backports to 6.1 the segment-boundary fix for embedded-route classification in
loggerMiddleware.6.1 already carries the earlier embedded-route work (the regex with an optional trailing slash). However, the first branch of that regex does not enforce an end-of-segment boundary after
embedded, soEMBEDDED_ROUTE_REGEX.test(...)also matches prefixes like/dashboard/123/embeddedXYZ, misclassifying those events withsource: 'embedded_dashboard'instead ofsource: 'dashboard'.This requires an end-of-segment boundary (
/,?,#, or end of string) afterembedded:The second branch (
/embedded/:uuid) is unchanged — its[^/]+already treats the UUID as a full segment.This mirrors the fix under review for master in #42005.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A — internal event-logging metadata change only.
TESTING INSTRUCTIONS
Unit tests in
superset-frontend/src/middleware/logger.test.tsadd coverage for the prefix case:/dashboard/123/embeddedXYZ/->dashboardalongside the existing embedded/regular-dashboard cases.
Run:
ADDITIONAL INFORMATION