You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Milan Siebenbürger (Jira)" <de...@myfaces.apache.org> on 2023/12/16 11:25:00 UTC
[jira] [Comment Edited] (MYFACES-4647) PushContextImpl send - NPE when no channel found for user
[ https://issues.apache.org/jira/browse/MYFACES-4647?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17797396#comment-17797396 ]
Milan Siebenbürger edited comment on MYFACES-4647 at 12/16/23 11:24 AM:
------------------------------------------------------------------------
sure, will do.
-but... I noticed another problem. The PushContext api specifies how the message should be- {-}handled{-}.
{code:java}
The message object will be encoded as JSON and be available as first argument of the JavaScript listener function declared in <f:websocket onmessage>. {code}
-This should be changed too. Do you agree? 4.1 and main (5.0) versions?-
-thx-
update: message is converted to Json, but myfaces implementation of Json (
org.apache.myfaces.push.Json) is handling message slightly differently as that one used in mojarra (com.sun.faces.util.Json). In mojarra is message inserted as "data" element in json.
Is that ok for you?
was (Author: milansi):
sure, will do.
but... I noticed another problem. The PushContext api specifies how the message should be handled.
{code:java}
The message object will be encoded as JSON and be available as first argument of the JavaScript listener function declared in <f:websocket onmessage>. {code}
This should be changed too. Do you agree? 4.1 and main (5.0) versions?
thx
> PushContextImpl send - NPE when no channel found for user
> ---------------------------------------------------------
>
> Key: MYFACES-4647
> URL: https://issues.apache.org/jira/browse/MYFACES-4647
> Project: MyFaces Core
> Issue Type: Task
> Affects Versions: 4.0.0, 4.0.1
> Reporter: Milan Siebenbürger
> Priority: Minor
>
> When trying to send a push message to a user who has already destroyed his web socket connection, PushContextImpl.send throws NPE
> java.lang.NullPointerException: Cannot invoke "java.util.Set.size()" because "channelTokenSet" is null
> at org.apache.myfaces.push.cdi.PushContextImpl.send(PushContextImpl.java:134)
> at org.apache.myfaces.push.cdi.PushContextImpl.send(PushContextImpl.java:122)
> Method should be null safe, just to continue with next user identification.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)