You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "semajnacnud (via GitHub)" <gi...@apache.org> on 2026/09/28 02:37:06 UTC

[PR] fix(frontend): sanitize null activeTabs in permalink payload to preve… [superset]

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

   …nt 400 error
   
   <!---
   Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/
   Example:
   fix(dashboard): load charts correctly
   -->
   
   ### SUMMARY
   <!--- Describe the change below, including rationale and design decisions -->
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] 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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(frontend): sanitize null activeTabs in permalink payload to preve… [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas closed pull request #44734: fix(frontend): sanitize null activeTabs in permalink payload to preve…
URL: https://github.com/apache/superset/pull/44734


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(frontend): sanitize null activeTabs in permalink payload to preve… [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #44734:
URL: https://github.com/apache/superset/pull/44734#issuecomment-6503122556

   Thanks for the fix @semajnacnud. CI is red and the null-to-[] change looks like it breaks default tab selection, so I'm going to close this. Happy to reopen with a description and a repro.


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(frontend): sanitize null activeTabs in permalink payload to preve… [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #44734:
URL: https://github.com/apache/superset/pull/44734#issuecomment-5862279867

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(frontend): sanitize null activeTabs in permalink payload to preve… [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on code in PR #44734:
URL: https://github.com/apache/superset/pull/44734#discussion_r4118098686


##########
superset-frontend/src/utils/urlUtils.ts:
##########
@@ -24,7 +24,7 @@ import {
 } from '@superset-ui/core';
 import Switchboard from '@superset-ui/switchboard';
 import rison from 'rison';
-import { isEmpty } from 'lodash-es';
+import { isEmpty } from 'lodash';

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Inconsistent lodash import</b></div>
   <div id="fix">
   
   This switches `isEmpty` from `lodash-es` to `lodash`, but the codebase imports `lodash-es` in 109 files vs `lodash` in 1. The change introduces an inconsistency against the established convention and pulls in the CJS build for a single symbol.
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #e7b6f3</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



##########
superset-frontend/src/utils/urlUtils.ts:
##########
@@ -234,14 +200,9 @@ async function resolvePermalinkUrl(
       // Silently fall back to default URL if Switchboard call fails
       // (e.g., if not in embedded context or callback throws)
     }
-    // Embedded host opted out (no callback, or threw): the backend URL is
-    // the only signal we have. Skip the origin rewrite — Superset is in
-    // an iframe and the iframe's origin is not necessarily reachable from
-    // where the user will paste the embed.
-    return { key, url };
   }
 
-  return { key, url: rewritePermalinkOrigin(url) };
+  return { key, url };

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Removed export breaks tests</b></div>
   <div id="fix">
   
   Removing the `rewritePermalinkOrigin` export breaks `urlUtils.test.ts`, which still imports it (line 23) and exercises it in tests at lines 188-290. TypeScript will fail with TS2305 'Module has no exported member'. Update or remove those tests in the same change.
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #e7b6f3</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(frontend): sanitize null activeTabs in permalink payload to preve… [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #44734:
URL: https://github.com/apache/superset/pull/44734#issuecomment-5862324397

   <!-- Bito Reply -->
   The flagged issue is correct. Converting `null` to `[]` causes the dashboard to treat the state as having no active tabs, which prevents the default tab from being selected during permalink hydration. 
   
   To resolve this, you should only include `activeTabs` in the payload if it is truthy and contains values, or ensure that `null` is handled by preserving the default behavior rather than forcing an empty array. 
   
   Here is the corrected implementation for `superset-frontend/src/utils/urlUtils.ts`:
   
   ```typescript
     // Only include activeTabs if it is defined and not null
     const payload: JsonObject = {
       urlParams: getDashboardUrlParams(),
       dataMask,
       ...(activeTabs && { activeTabs }),
       anchor,
     };
   ```
   
   I have checked the PR and there are no other comments to address. Would you like me to proceed with any other changes?
   
   **superset-frontend/src/utils/urlUtils.ts**
   ```
   // Only include activeTabs if it is defined and not null
     const payload: JsonObject = {
       urlParams: getDashboardUrlParams(),
       dataMask,
       ...(activeTabs && { activeTabs }),
       anchor,
     };
   ```


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(frontend): sanitize null activeTabs in permalink payload to preve… [superset]

Posted by "sadpandajoe (via GitHub)" <gi...@apache.org>.
sadpandajoe commented on PR #44734:
URL: https://github.com/apache/superset/pull/44734#issuecomment-5875190785

   I'm going to mark this as draft until there is a PR description and CI passes. 


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(frontend): sanitize null activeTabs in permalink payload to preve… [superset]

Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on code in PR #44734:
URL: https://github.com/apache/superset/pull/44734#discussion_r4118091862


##########
superset-frontend/src/utils/urlUtils.ts:
##########
@@ -291,10 +252,12 @@ export async function getDashboardPermalink({
    */
   includeChartState?: boolean;
 }): Promise<PermalinkResult> {
+  // Strip out any null or undefined values injected by the state manager
+  const sanitizedTabs = activeTabs ? activeTabs.filter(tab => tab != null) : [];

Review Comment:
   **Suggestion:** Converting null `activeTabs` to truthy `[]` makes permalink hydration skip the dashboard’s default active tab, leaving no tab selected.
   
   **Assessment:** 🟠 `Major` · 🔁 `Occurrence: Sometimes` · 🏷️ `Logic error`
   
   [![Use CodeAnt Skill](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/use-codeant-skill-flat-v2.svg)](https://docs.codeant.ai/cli/resolve-pr-comments-skill) [![Fix in Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=5c8bbee0dd5b41ccad79fa3e166d91bc&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) [![Fix in VSCode Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=5c8bbee0dd5b41ccad79fa3e166d91bc&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset-frontend/src/utils/urlUtils.ts
   **Line:** 256:256
   **Comment:**
   	*Logic Error: Converting null `activeTabs` to truthy `[]` makes permalink hydration skip the dashboard’s default active tab, leaving no tab selected.
   
   Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
   Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
   ```
   </details>
   <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F44734&comment_hash=1777ab712f8ce6497cbaeece66ee9e5e5bc502971ebdba9b0c787d38c35fbf76&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F44734&comment_hash=1777ab712f8ce6497cbaeece66ee9e5e5bc502971ebdba9b0c787d38c35fbf76&reaction=dislike'>👎</a>



-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(frontend): sanitize null activeTabs in permalink payload to preve… [superset]

Posted by "netlify[bot] (via GitHub)" <gi...@apache.org>.
netlify[bot] commented on PR #44734:
URL: https://github.com/apache/superset/pull/44734#issuecomment-5862301208

   ### <span aria-hidden="true">✅</span> Deploy Preview for *superset-docs-preview* ready!
   
   
   |  Name | Link |
   |:-:|------------------------|
   |<span aria-hidden="true">🔨</span> Latest commit | 53abec9ba3bb64cba1471b8a12201bc002a1ef56 |
   |<span aria-hidden="true">🔍</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/6ab9d2d3b81e210008f7fd85 |
   |<span aria-hidden="true">😎</span> Deploy Preview | [https://deploy-preview-44734--superset-docs-preview.netlify.app](https://deploy-preview-44734--superset-docs-preview.netlify.app) |
   |<span aria-hidden="true">📱</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br />![QR Code](https://app.netlify.com/qr-code/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1cmwiOiJodHRwczovL2RlcGxveS1wcmV2aWV3LTQ0NzM0LS1zdXBlcnNldC1kb2NzLXByZXZpZXcubmV0bGlmeS5hcHAifQ.qVq3CSYhv0SxJa0oLAb3IgVHRmhea9i-ZwMuVxzJCSU)<br /><br />_Use your smartphone camera to open QR code link._</details> |
   |<span aria-hidden="true">🤖</span> Make changes | [Run an agent on this branch](https://app.netlify.com/projects/superset-docs-preview/agent-runs#q1YqKMrPLShRslJS0lFKKkrMS84AstMyK_STc1IT83QLUotyE3My87KB0impBTn5lZ4pQAVmiUmWKUYpxkkWhqlGhgYGBhZp5mkpFqZKtQA) |
   ---
   <!-- [superset-docs-preview Preview](https://deploy-preview-44734--superset-docs-preview.netlify.app) -->
   _To edit notification comments on pull requests, go to your [Netlify project configuration](https://app.netlify.com/projects/superset-docs-preview/configuration/notifications#deploy-notifications)._


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org