gabotorresruiz commented on code in PR #37681:
URL: https://github.com/apache/superset/pull/37681#discussion_r2879582692


##########
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx:
##########
@@ -144,12 +144,12 @@ const publishDataMask = debounce(
       // it when necessary. We strip any prefix so that history.replace adds 
it back and doesn't
       // double it up.
       const appRoot = applicationRoot();
-      let replacement_pathname = window.location.pathname;
-      if (appRoot !== '/' && replacement_pathname.startsWith(appRoot)) {
-        replacement_pathname = replacement_pathname.substring(appRoot.length);
+      let replacementPathname = window.location.pathname;
+      if (appRoot !== '/' && replacementPathname.startsWith(appRoot)) {
+        replacementPathname = replacementPathname.substring(appRoot.length);
       }
-      history.location.pathname = replacement_pathname;
       history.replace({
+        pathname: replacementPathname,
         search: newParams.toString(),

Review Comment:
   The `applicationRoot()` function already strips trailing slashes via 
`normalizePathWithFallback`, which calls `.replace(/\/$/, '')`. So `/superset/` 
becomes `/superset`, and substring always preserves the leading `/`. This 
scenario can't happen with the current implementation.



-- 
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