milansie commented on code in PR #705:
URL: https://github.com/apache/myfaces/pull/705#discussion_r1573884876
##########
impl/src/main/java/org/apache/myfaces/push/cdi/WebsocketScopeManager.java:
##########
@@ -161,26 +161,12 @@ public static class ViewScope extends AbstractUserScope
implements Serializable
@Inject private WebsocketScopeManager scopeManager;
@Inject private WebsocketSessionManager sessionManager;
- /*
- * If the view is discarded, destroy the websocket sessions associated
with the view because they are no
- * longer valid
- */
@PreDestroy
public void destroy()
{
- // destroy parent scope ("session")
- SessionScope sessionScope = (SessionScope)
scopeManager.getScope(SCOPE_SESSION, false);
- if (sessionScope != null)
- {
- for (String token : tokens.keySet())
- {
- sessionScope.destroyChannelToken(token);
- }
- }
-
channelTokens.clear();
tokens.clear();
- }
+ }
Review Comment:
I am able to simulate this behavior, destroying viewScope comes from
SerializedViewCollection, where at the end of method put is something like
`destroyCallback.accept(oldViewScopeId);`, where the viewScope is destroyed
(and also sessionScope channels).
Since then we are not able to register new websocket connection
`org.apache.myfaces.push.EndpointImpl#onOpen`,
`sessionManager.addOrUpdateSession(channelToken, session)` fails and websocket
connection is closed with `CloseCodes.UNEXPECTED_CONDITION`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]