codeant-ai-for-open-source[bot] commented on code in PR #41132:
URL: https://github.com/apache/superset/pull/41132#discussion_r3425006670


##########
superset-frontend/src/components/Tag/utils.test.tsx:
##########
@@ -166,7 +166,7 @@ describe('loadTags', () => {
     const calls = fetchMock.callHistory.calls();
 
     // Verify all calls include the custom tag filter
-    calls.forEach(call => {
+    calls.forEach(_call => {

Review Comment:
   **Suggestion:** This change silences the unused callback parameter instead 
of validating each request, so the test still only checks the first recorded 
call repeatedly and can pass even when later calls are wrong. Use the iterated 
call item in the loop body so every request URL is decoded and asserted. [logic 
error]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ❌ Tag API filter regressions undetected for later calls.
   - ⚠️ Tag selector UI may mis-filter search results.
   ```
   </details>
   <details>
   <summary><b>Steps of Reproduction ✅ </b></summary>
   
   ```mdx
   1. Run frontend tests, including `always includes custom tag filter 
regardless of other
   parameters` in `superset-frontend/src/components/Tag/utils.test.tsx:26-54`.
   
   2. Inside this test, multiple calls to `loadTags()` are made at lines 33-35, 
then `const
   calls = fetchMock.callHistory.calls();` is executed at line 37 to capture 
all HTTP
   requests.
   
   3. The loop at line 40, `calls.forEach(_call => {`, ignores the `_call` item 
and instead
   always uses `const { url } = calls[0];` at line 41, so only the first 
recorded request URL
   is decoded and asserted; later calls are never checked.
   
   4. If you modify `loadTags` in 
`superset-frontend/src/components/Tag/utils.tsx:9-24` so
   that only the second or third invocation omits the `{ col: 'type', opr: 
'custom_tag',
   value: true }` filter, this test will still pass, demonstrating the logic 
bug that it does
   not actually validate every call.
   ```
   </details>
   
   [![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=86d346a371cb4c97a92c9388344cd39e&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=86d346a371cb4c97a92c9388344cd39e&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
   
   *(Use Cmd/Ctrl + Click for best experience)*
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset-frontend/src/components/Tag/utils.test.tsx
   **Line:** 169:169
   **Comment:**
        *Logic Error: This change silences the unused callback parameter 
instead of validating each request, so the test still only checks the first 
recorded call repeatedly and can pass even when later calls are wrong. Use the 
iterated call item in the loop body so every request URL is decoded and 
asserted.
   
   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%2F41132&comment_hash=7e8567ba88d66a390d33c155198ccad6b9c76c2e558b89cc42efdc28339ca33e&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41132&comment_hash=7e8567ba88d66a390d33c155198ccad6b9c76c2e558b89cc42efdc28339ca33e&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: [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