Skip to content

Commit dbba8b1

Browse files
committed
Uncomment assertion for context propagation
Closes gh-342
1 parent 218b16e commit dbba8b1

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

spring-graphql/src/main/java/org/springframework/graphql/server/webmvc/GraphQlWebSocketHandler.java

+3-6
Original file line numberDiff line numberDiff line change
@@ -365,12 +365,9 @@ public void afterHandshake(
365365
public Closeable restoreThreadLocalValue(WebSocketSession session) {
366366
if (this.accessor != null) {
367367
Map<String, Object> valuesMap = (Map<String, Object>) session.getAttributes().get(SAVED_CONTEXT_KEY);
368-
// Uncomment when Boot is updated to use HandshakeInterceptor
369-
// Assert.state(valuesMap != null, "No context");
370-
if (valuesMap != null) {
371-
this.accessor.restoreValues(valuesMap);
372-
return () -> this.accessor.resetValues(valuesMap);
373-
}
368+
Assert.state(valuesMap != null, "No ThreadLocal context in WebSocketSession attributes");
369+
this.accessor.restoreValues(valuesMap);
370+
return () -> this.accessor.resetValues(valuesMap);
374371
}
375372
return () -> {};
376373
}

0 commit comments

Comments
 (0)