Skip to content

Commit

Permalink
Merge pull request #19530 from bigbluebutton/revert-19523-middleware-…
Browse files Browse the repository at this point in the history
…stop-retransmitting-mutations

Revert "Prevent graphql-middlware from re-transmitting Mutations"
  • Loading branch information
gustavotrott committed Jan 26, 2024
2 parents 94a2f77 + 3be1f84 commit a288d84
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions bbb-graphql-middleware/internal/hascli/conn/writer/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,23 +96,20 @@ RangeLoop:
jsonPatchSupported = true
}

//Not storing Mutations because they will not be retransmitted in case of reconnection
if messageType != common.Mutation {
browserConnection.ActiveSubscriptionsMutex.Lock()
browserConnection.ActiveSubscriptions[queryId] = common.GraphQlSubscription{
Id: queryId,
Message: fromBrowserMessageAsMap,
OperationName: operationName,
StreamCursorField: streamCursorField,
StreamCursorVariableName: streamCursorVariableName,
StreamCursorCurrValue: streamCursorInitialValue,
LastSeenOnHasuraConnetion: hc.Id,
JsonPatchSupported: jsonPatchSupported,
Type: messageType,
}
// log.Tracef("Current queries: %v", browserConnection.ActiveSubscriptions)
browserConnection.ActiveSubscriptionsMutex.Unlock()
browserConnection.ActiveSubscriptionsMutex.Lock()
browserConnection.ActiveSubscriptions[queryId] = common.GraphQlSubscription{
Id: queryId,
Message: fromBrowserMessageAsMap,
OperationName: operationName,
StreamCursorField: streamCursorField,
StreamCursorVariableName: streamCursorVariableName,
StreamCursorCurrValue: streamCursorInitialValue,
LastSeenOnHasuraConnetion: hc.Id,
JsonPatchSupported: jsonPatchSupported,
Type: messageType,
}
// log.Tracef("Current queries: %v", browserConnection.ActiveSubscriptions)
browserConnection.ActiveSubscriptionsMutex.Unlock()
}

if fromBrowserMessageAsMap["type"] == "stop" {
Expand Down

0 comments on commit a288d84

Please sign in to comment.