Opened 7 years ago

Closed 7 years ago

#4688 closed defect (fixed)

Lobby - Error when receiving messages sent directly by the server

Reported by: elexis Owned by: elexis
Priority: Should Have Milestone: Alpha 23
Component: Multiplayer lobby Keywords:
Cc: Patch:

Description

When selecting the "Set message of the day and send to online users" as a lobby moderator in option in pidgin, the following JS error occurs with alpha 22:

WARNING: JavaScript warning: gui/lobby/lobby.js line 232
reference to undefined property msg.from
WARNING: JavaScript warning: gui/lobby/lobby.js line 232
Script value conversion check failed: v.isString() || v.isNumber() (got type undefined)

Attachments (1)

server_pm.jpg (36.3 KB ) - added by elexis 7 years ago.

Download all attachments as: .zip

Change History (16)

comment:1 by gameboy, 7 years ago

Today, I tested it, and it does exist.

comment:2 by elexis, 7 years ago

Milestone: BacklogAlpha 23
Priority: If Time PermitsShould Have

Unless someone else is sending the message of the day, other message types can trigger that warning too. Apparently it's not rare.

comment:3 by Stan, 7 years ago

I think I experienced it when enabling the lobby chat log for the first time.

comment:4 by fatherbushido, 7 years ago

(I have that each I connect to the lobby with a new account - it's the way I reproduce it)

edit: as stanislas69 said

Last edited 7 years ago by fatherbushido (previous) (diff)

comment:5 by elexis, 7 years ago

svn lobby that is? When I connect to the a22 or svn lobby I don't get the error message (but I had it few days ago again when I didn't send such a mesage of the day).

comment:6 by fatherbushido, 7 years ago

Each time I connect on a22 lobby with a new account.

edit: never on svn lobby

Last edited 7 years ago by fatherbushido (previous) (diff)

comment:7 by gameboy, 7 years ago

Is there a solution to this problem? These annoying warnings always cause messages to fail on the server.

by elexis, 7 years ago

Attachment: server_pm.jpg added

comment:8 by elexis, 7 years ago

It was also reported here https://wildfiregames.com/forum/index.php?/topic/22747-lobby-warning/

As fatherbushido said, the warning can also be triggered when creating a new lobby account (not however when just enabling chat backlog for the first time, nor when switching accounts or the like).

This way I could record the weird package. It seems to be a server welcome message, but that however is currently disabled. I joined the Alpha 23 room, but the message says it's the alpha 21 room and that alpha 22 has been released, so not sure where that's coming from.

https://trac.wildfiregames.com/raw-attachment/ticket/4688/server_pm.jpg

Notice that this isn't even the Alpha 21 subject, as that is currently (it's red not green for example):

elexis has set the subject to: [color="255 0 0"]Alpha 22 has been released. Check play0ad.com for download information.

Ya está liberada la nueva versión de 0 .A.D. (Alpha 22). Para descargarla e informarte sobre su instalación, visita play0ad.com.

Alpha 22 foi lançado. Acesse play0ad.com para maiores informações e download.
[/color]

It's not the ejabberd welcome message for new accounts either:

  {mod_register, [
		  %%
		  %% After successful registration, the user receives
		  %% a message with this subject and body.
		  %%
%%		  {welcome_message, {"Welcome!",
%%				     "Welcome to a Jabber service powered by Debian. "
%%				     "For information about Jabber visit "
%%				     "http://www.jabber.org"}},
		  %% Replace it with 'none' if you don't want to send such message:
		  {welcome_message, none},

So to me it seems that we should rather display these messages and configure to server to not send unintentional ones.

Last edited 7 years ago by elexis (previous) (diff)

comment:9 by elexis, 7 years ago

Summary: Lobby - Error when receiving the Message of the dayLobby - Error when receiving messages sent directly by the server

comment:10 by gameboy, 7 years ago

But that's the message that Pidgin sends out, unless we don't use Pidgin to send a group message.

comment:11 by gameboy, 7 years ago

Ok, my friend, please take time to solve this problem. Thank you.

comment:12 by elexis, 7 years ago

scythetwirler gave the clue that the quoted message above is in fact the message of the day. It is sent to any registering account for any reason.

We came to the conclusion that we should support them, open a message box and show it in the chat.

comment:13 by elexis, 7 years ago

So there are two known ways to trigger that error. 1. "message of the day" and 2. "announcements", see https://www.ejabberd.im/files/doc/guide.html#htoc33. The according code is here https://github.com/processone/ejabberd/blob/master/src/mod_announce.erl.

However I couldn't reproduce receiving such a message upon every login. I only get the error once per message sent for both announcements and message of the day.

Since we will almost never use this feature and since pidgin also only shows "servername: <message body>" without showing the <message subject>, I think not knowing all ways to trigger this message, just showing a message box and chat line will be sufficient to close this case code-wise.

However, if this is implemented, then gameboy might get a message box saying "hello" each time he joins the lobby instead of a warning and might be equally annoyed (so the forum thread must be closed as works-for-me or solved by resolving gameboy's ejabberd configuration I guess).

Perhaps the "hello" message gameboy receives is not the one sent from pidgin but configured in the ejabberd config or code.

There is a patch which does that: https://www.ejabberd.im/node/4857.

comment:14 by gameboy, 7 years ago

How do I use this patch?

comment:15 by elexis, 7 years ago

Owner: set to elexis
Resolution: fixed
Status: newclosed

In 20005:

Support the Message of the Day and Announcements sent by the lobby administrator instead of throwing a JS warning.

Display a message box for these as proposed by scythetwirler. Add a comment explaining the origin of messages without "from" property, so that commits like rP19250 don't remove that check unknowingly.
Document that We intend to not support private messages between users, refs #3865, P61.

Fixes #4688.
Document that we currently don't intend to support private messages between users, refs #3865, P61.

Note: See TracTickets for help on using tickets.