YuriyKrasilnikov opened a new issue, #37977:
URL: https://github.com/apache/superset/issues/37977

   ### Bug description
   
   After PR #32341 replaced lodash `filter()` with native `.filter()`, the home 
page crashes with TypeError when `otherTabData` is undefined.
   
   **Error:**
   ```
   TypeError: Cannot read properties of undefined (reading 'filter')
   ```
   
   **Location:** `superset-frontend/src/features/home/DashboardTable.tsx:65`
   
   ```typescript
   const filteredOtherTabData = otherTabData.filter(obj => !('viz_type' in 
obj));
   ```
   
   ### Root cause
   
   PR #32341 changed:
   ```typescript
   // Before (lodash - handles undefined gracefully):
   const filteredOtherTabData = filter(otherTabData, obj => !('viz_type' in 
obj));
   
   // After (native - crashes on undefined):
   const filteredOtherTabData = otherTabData.filter(obj => !('viz_type' in 
obj));
   ```
   
   Lodash's `filter()` returns `[]` when collection is undefined, but native 
`.filter()` throws TypeError.
   
   ### When it happens
   
   `otherTabData` comes from `activityData?.[TableTab.Other]` in 
`Home/index.tsx:394`. When the activity API returns Forbidden (403) or fails, 
`activityData` doesn't have the `Other` key, resulting in undefined.
   
   ### Suggested fix
   
   ```typescript
   const filteredOtherTabData = (otherTabData ?? []).filter(obj => !('viz_type' 
in obj));
   ```
   
   ### How to reproduce
   
   1. Start Superset with a fresh database or user without proper permissions
   2. Login and navigate to home page
   3. If activity API returns 403 Forbidden, the page crashes
   
   ### Screenshots/recordings
   
   N/A - reproducible via steps above
   
   ### Superset version
   
   6.0.0 (introduced in this version via #32341)
   
   ### Python version
   
   3.11
   
   ### Node version
   
   20
   
   ### Browser
   
   Chromium 133
   
   ### Additional context
   
   Regression introduced by #32341 (merged Feb 21, 2025)


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