Fix a bug when user get Presenter

This commit is contained in:
Gustavo Trott 2024-01-31 19:20:57 -03:00
parent 8f7c23e175
commit d7f92f918c
2 changed files with 4 additions and 3 deletions

View File

@ -48,7 +48,7 @@ func HasuraConnectionReader(hc *common.HasuraConnection, fromHasuraToBrowserChan
hc.Browserconn.ActiveSubscriptionsMutex.RUnlock()
if !ok {
log.Debugf("Subscription with Id %s doesn't exist anymore, skiping response.", queryId)
return
continue
}
//When Hasura send msg type "complete", this query is finished

View File

@ -136,16 +136,17 @@ func InvalidateSessionTokenConnections(sessionTokenToInvalidate string) {
for _, browserConnection := range BrowserConnections {
if browserConnection.SessionToken == sessionTokenToInvalidate {
if browserConnection.HasuraConnection != nil {
// Wait until there are no active mutations
for iterationCount := 0; iterationCount < 100; iterationCount++ {
for iterationCount := 0; iterationCount < 20; iterationCount++ {
activeMutationFound := false
browserConnection.ActiveSubscriptionsMutex.RLock()
for _, subscription := range browserConnection.ActiveSubscriptions {
if subscription.Type == common.Mutation {
activeMutationFound = true
break
}
}
browserConnection.ActiveSubscriptionsMutex.RUnlock()
if !activeMutationFound {
break
}