bito-code-review[bot] commented on PR #40729:
URL: https://github.com/apache/superset/pull/40729#issuecomment-4636606380

   <!-- Bito Reply -->
   The flagged issue is correct. The `pluginsReady` promise chain in `start()` 
lacks a rejection handler, which causes unhandled promise rejections and 
prevents the `started` flag from being reset if `setupPlugins()` or 
`setupCodeOverrides()` fails. This effectively locks the embedded dashboard in 
a failed state.
   
   To resolve this, you should attach a `.catch()` handler to the 
`pluginsReady` promise chain within `start()` to log the error and reset the 
`started` flag, allowing for retries.
   
   ### Proposed Fix
   
   In `superset-frontend/src/embedded/index.tsx`, update the `start()` function 
as follows:
   
   ```typescript
     return pluginsReady
       .catch(err => {
         logging.error('Plugin initialization failed', err);
         started = false;
         showFailureMessage(t('Failed to initialize plugins.'));
       })
       .then(() =>
         getMeWithRole().then(
           ({ result }) => {
             // ... existing success logic
           },
           err => {
             // ... existing error logic
             started = false;
           },
         ),
       );
   ```
   
   Would you like me to check the rest of the comments on this PR and implement 
fixes for them as well?
   
   **superset-frontend/src/embedded/index.tsx**
   ```
   return pluginsReady
       .catch(err => {
         logging.error('Plugin initialization failed', err);
         started = false;
         showFailureMessage(t('Failed to initialize plugins.'));
       })
       .then(() =>
         getMeWithRole().then(
           ({ result }) => {
             // ... existing success logic
           },
           err => {
             // ... existing error logic
             started = false;
           },
         ),
       );
   ```


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