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
fix subscriptions by not removing the ak subscription when one of the… (ExpediaGroup#510)
* fix subscriptions by not removing the ak subscription when one of the subscriptions is stopped.
* Prevent cancelling subscription for someone else of operation name is the same, by including operation name in the id. Keep hasmaps clean by removing canceled subscriptions
Copy file name to clipboardExpand all lines: graphql-kotlin-spring-server/src/main/kotlin/com/expediagroup/graphql/spring/execution/ApolloSubscriptionProtocolHandler.kt
+37-23Lines changed: 37 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -44,10 +44,10 @@ class ApolloSubscriptionProtocolHandler(
Copy file name to clipboardExpand all lines: graphql-kotlin-spring-server/src/test/kotlin/com/expediagroup/graphql/spring/execution/ApolloSubscriptionProtocolHandlerTest.kt
+7-2Lines changed: 7 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -85,7 +85,9 @@ class ApolloSubscriptionProtocolHandlerTest {
85
85
}
86
86
}
87
87
val operationMessage =SubscriptionOperationMessage(GQL_CONNECTION_INIT.type)
88
-
val session:WebSocketSession= mockk()
88
+
val session:WebSocketSession= mockk {
89
+
every { id } returns "123"
90
+
}
89
91
val subscriptionHandler:SubscriptionHandler= mockk()
90
92
91
93
val handler =ApolloSubscriptionProtocolHandler(config, subscriptionHandler, objectMapper)
@@ -104,7 +106,9 @@ class ApolloSubscriptionProtocolHandlerTest {
104
106
}
105
107
}
106
108
val operationMessage =SubscriptionOperationMessage(GQL_CONNECTION_INIT.type)
107
-
val session:WebSocketSession= mockk()
109
+
val session:WebSocketSession= mockk {
110
+
every { id } returns "123"
111
+
}
108
112
val subscriptionHandler:SubscriptionHandler= mockk()
109
113
110
114
val handler =ApolloSubscriptionProtocolHandler(config, subscriptionHandler, objectMapper)
@@ -143,6 +147,7 @@ class ApolloSubscriptionProtocolHandlerTest {
143
147
val config:GraphQLConfigurationProperties= mockk()
144
148
val operationMessage =SubscriptionOperationMessage(GQL_CONNECTION_TERMINATE.type)
145
149
val session:WebSocketSession= mockk {
150
+
every { id } returns "123"
146
151
every { close() } returns mockk()
147
152
}
148
153
val subscriptionHandler:SubscriptionHandler= mockk()
0 commit comments