You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// If a session doesn't already exist just create it
26
-
returnthis.createSession(tabID)
27
-
}
28
-
returnsessionFromStorage
26
+
/**
27
+
* The lock here is added in order to mitigate amazon Q's eventing fire & forget design when integrating with mynah-ui that creates a race condition here.
28
+
* The race condition happens when handleDevFeatureCommand in src/amazonq/webview/ui/quickActions/handler.ts is firing two events after each other to amazonqFeatureDev controller
29
+
* This eventually may make code generation fail as at the moment of that event it may get from the storage a session that has not been properly updated.
30
+
*/
31
+
returnthis.lock.acquire(tabID,async()=>{
32
+
constsessionFromStorage=this.sessions.get(tabID)
33
+
if(sessionFromStorage===undefined){
34
+
// If a session doesn't already exist just create it
35
+
returnthis.createSession(tabID)
36
+
}
37
+
returnsessionFromStorage
38
+
})
29
39
}
30
40
31
41
// Find all sessions that are currently waiting to be authenticated
0 commit comments