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

   ### SUMMARY
   
   The `.then()` handler inside the dashboard tabs `useEffect` in 
`AlertReportModal` crashes when:
   - `nativeFilters[anchor]` is `undefined` (tab with no scoped native filters)
   - `allTabs` is `null` (malformed payload)
   - `nativeFilters` is missing entirely from the API response
   
   The outer `.catch()` then displays a misleading "There was an error 
retrieving dashboard tabs" toast, even though the API call itself succeeded.
   
   **Fixes:**
   - `nativeFilters ?? {}` guard prevents `Object.values(undefined)` crash on 
`tabNativeFilters`
   - `nativeFilters?.[anchor] ?? []` prevents TypeError when anchor key is 
missing from `native_filters`
   - `allTabs &&` / `!allTabs ||` guards prevent crash on `in` operator with 
null operand
   - `nativeFilters?.all` optional chaining prevents crash when 
`native_filters` is omitted
   - Replaced 3 `any` annotations with `NativeFilterObject` for type safety
   
   **Tests:** 7 new regression tests covering all crash paths, using Redux 
store-based toast assertions and payload-level state verification.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   N/A — error toast no longer appears; no visual changes.
   
   ### TESTING INSTRUCTIONS
   
   1. Create a dashboard with tabs and at least one native filter
   2. Create a report targeting that dashboard and select a specific tab
   3. Open the edit modal for the report
   4. Verify no "There was an error retrieving dashboard tabs" error toast 
appears
   5. Verify tab selection and filter dropdowns work correctly
   6. Also test with a dashboard that has tabs but zero native filters
   
   ### 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