luizotavio32 opened a new pull request, #42048:
URL: https://github.com/apache/superset/pull/42048

   ### SUMMARY
   
   Backports the stricter embedded-route detection regex from `master` to the 
`6.1` branch.
   
   On `6.1`, `EMBEDDED_ROUTE_REGEX` matched `embedded` followed by an optional 
slash (`embedded\/?`), which also matched paths where `embedded` was only a 
prefix of a segment — e.g. `/dashboard/123/embeddedXYZ/` was wrongly classified 
as an embedded dashboard.
   
   `master` uses a segment-boundary form (`embedded(?:[/?#]|$)`) that requires 
`embedded` to be a complete path segment. This backport aligns `6.1` with that 
behavior:
   
   - `/dashboard/:idOrSlug/embedded` and `/embedded/:uuid/` (with or without a 
trailing slash) still match.
   - `/dashboard/123/embeddedXYZ/` is now correctly treated as a regular 
dashboard.
   
   A guard test case (`/dashboard/123/embeddedXYZ/` -> `dashboard`) is added to 
lock in the segment-boundary behavior.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   N/A — internal event-logging metadata change only.
   
   ### TESTING INSTRUCTIONS
   
   ```bash
   cd superset-frontend
   npm run test -- src/middleware/logger.test.ts
   ```
   
   All cases pass, including:
   
   - `/dashboard/123/embedded/` -> `embedded_dashboard`
   - `/embedded/abc-def-uuid/` -> `embedded_dashboard`
   - `/dashboard/123/embedded` -> `embedded_dashboard`
   - `/embedded/abc-def-uuid` -> `embedded_dashboard`
   - `/dashboard/123/` -> `dashboard`
   - `/dashboard/embedded/` (slug is literally `embedded`) -> `dashboard`
   - `/dashboard/123/embeddedXYZ/` -> `dashboard`
   
   ### ADDITIONAL INFORMATION
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to