pachara-strike commented on code in PR #37280:
URL: https://github.com/apache/superset/pull/37280#discussion_r2721175730


##########
superset-embedded-sdk/src/index.ts:
##########
@@ -249,13 +249,17 @@ export async function embedDashboard({
   ourPort.emit('guestToken', { guestToken });
   log('sent guest token');
 
+  let refreshTokenTimerId: ReturnType<typeof setTimeout> | 'INITIAL' | 
'UNMOUNTED' = 'INITIAL';

Review Comment:
   It's to fix race condition problem from this comment 
https://github.com/apache/superset/pull/37280#discussion_r2713921073
   
   It will happen when call unmount function during waiting for new guest token 
response. So unmount function will clear the old `setTimeout` and 
`refreshGuestToken` will create a new `setTimeout`.



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