symphonyoss / symphony-java-client

Java client library for Symphony

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MessageService not routing messages when message sender is symClient local user

dferguson992 opened this issue · comments

commented

The MessageService is not routing messages through the MessageService's onEvent method when the symClient's local user has the same ID has the message's sending user ID.

MessageService.java, LINE 276:
if (symMessage != null && !symClient.getLocalUser().getId().equals(symMessage.getFromUserId())) {

Why is this even checked? A few releases ago, this line just checked if the symMessage's ID was null; I don't recall it ever checking who sent the message.

Also, under what circumstances will the SymClient's Local User ever be different from the SymMessage's Sender User?

Historically, the REST API Datafeed publishes all events inclusive of the sender.

In the context of the SJC real-time services layer, the bot (sender) has no need to process a message it's already aware of from a transmission perspective. There really should be no use cases where the message needs to be processed by the sender(itself), so its dropped.

I believe that check was always there.

On the second question, Local User represents the user associated with the SJC instance. The sender would be the SymMessage.getFromUserId() constructed from a MESSAGESENT in the context of the MessageService. Again, you can have an MESSAGESENT event that is coming from both bot itself and/or external user to the bot.

Let me know if you have any other questions....

commented

I did some more digging and it seems like the message I was referring to in my initial comment is a message I am deliberately not responding to. I got it confused with a message that I am deliberately trying to respond to.

The message I am deliberately trying to respond to seems to get passed over, and the Message Service only seems to be getting the messages not sent by me. The Message Service doesn't even see my initial message, only the messages I am deliberately ignoring.