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

   ### SUMMARY
   
   Follow-up to #41942, which replaced the substring `/embedded/` check in 
`loggerMiddleware` with a regex matching the actual embedded route shapes 
(`/dashboard/:idOrSlug/embedded/` and `/embedded/:uuid/`).
   
   That regex required a **trailing slash** after the slug/UUID. However, the 
embedded routes are registered non-strict in React Router 
(`superset-frontend/src/embedded/index.tsx`), so they also match without a 
final slash — e.g. `/dashboard/123/embedded` and `/embedded/<uuid>`. For those 
URLs the regex failed to match, so the events were classified with `source: 
'dashboard'` (or omitted) instead of `source: 'embedded_dashboard'`, 
misreporting embedded-dashboard usage in the event log.
   
   This makes the trailing slash optional in both branches of the regex:
   
   ```diff
   -  /\/dashboard\/[^/]+\/embedded\/|\/embedded\/[^/]+\//;
   +  /\/dashboard\/[^/]+\/embedded\/?|\/embedded\/[^/]+\/?/;
   ```
   
   ### 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.ts` now cover 
the no-trailing-slash variants:
   
   - `/dashboard/123/embedded` -> `embedded_dashboard`
   - `/embedded/abc-def-uuid` -> `embedded_dashboard`
   
   alongside the existing trailing-slash and regular-dashboard cases.
   
   Run:
   
   ```bash
   cd superset-frontend
   npm run test -- src/middleware/logger.test.ts
   ```
   
   ### 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