rusackas opened a new pull request, #40870: URL: https://github.com/apache/superset/pull/40870
### SUMMARY Two robustness fixes in the embedded SDK's `embedDashboard`: 1. **fetchGuestToken timeout** — the host-provided `fetchGuestToken` callback was awaited with no timeout, so a callback that never settles would hang the initial embed and every refresh cycle. Each call is now wrapped in a timeout via a new optional `guestTokenFetchTimeoutMs` parameter (default `30000`ms; `0` disables it). The wrapper is extracted to `withTimeout.ts` and unit-tested. 2. **Refresh timer cleanup** — the recurring `setTimeout(refreshGuestToken, …)` handle was never stored, so `unmount()` could not cancel it. The pending timer is now tracked and cleared on unmount, and the refresh loop stops once unmounted, so timers no longer accumulate across mount/unmount cycles. Both changes are backward compatible (the new param is optional; default behavior only adds a generous 30s safety timeout). ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF N/A — SDK behavior. ### TESTING INSTRUCTIONS ``` cd superset-embedded-sdk npm ci npm test ``` New `withTimeout` tests: resolves in time, rejects on timeout, and passes through when disabled. ### ADDITIONAL INFORMATION - [ ] Has associated issue: - [ ] Required feature flags: - [ ] Changes UI - [ ] Includes DB Migration - [x] Introduces new feature or API - [ ] Removes existing feature or API 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
