[Chat] Java error in Chat Module

[Chat] Java error in Chat Module

Forge Component
Published on 2015-11-24 by Hélio Dolores
31 votes
Published on 2015-11-24 by Hélio Dolores
Hi everyone,
I install the Chat module but when I loging like Admin, ocurre the following errors:
1. Uncaught TypeError: Cannot read property 'scrollHeight' of undefined
2. Uncaught TypeError: Cannot read property 'picHash' of undefined
If I use another account these error do not occur.  Please see the picture for reference.

Thanks for help,
Hi Pedro,

I'm sorry for the late reply.
I can see that you have communication errors in the javascript console, the next errors may be due to that issue.

Have you tried in different networks to see if you have the same error? 
- From home
- From office

You may be behind very restrict firewall rules.

Can you please make this test?


Hi Hélio, I did the test in differents places, home and work using 2 different computers. When I used the Admin account then pop these errors, another user no errors.
Hi Pedro,

Can you communicate with 2 regular users? (no admins)
Regular user only can see the Admin.  Admin can see all user when receive the message.  
First image User1, can see (online) Administrator,  Second Image is my user only can see Admin (green is online) and the last is the admin view with the other two users.

Have you changed the permissions after or before seting up the node.js server?

Can you restart the RH application?

Done.  But still in same situation.  
Damn... we can try to see exactly which permission is generation this error.

I would do the following: 

1. Remove all permission rules
2. Restart RH server

Test if ok

1. Add 1st rule
2. Restart RH server

Test if ok


You should at least see all the users with no permissions.

Hi Pedro,

(Finally) I was able to reproduce the issue on my side and I will fix this as soon as possible (maybe this weekend).

Thanks for the feedback!
Hi Pedro, 

Can you please test this new version? You just need to upgrade the Chat application.

Best regards,


After fresh installation,


admin view

After several Nodejs restart,


Admin view

For me is a good news, but question, I only see Admin user from the User1 view and any other user view?


Hi Pedro,

Can you show me the permission configurations you have in the chat backoffice?

Hi Hélio,

See attachment.

Hi again,

Why are your windows in the middle of the page? is that a bug or is this a full window screen shot?

I can't see why the users are not appearing...

What we can do is to check:
- Is the node.js server able to access any page of the chat application? Is your server open to the world?
- Do you have any error in the node.js server log?
- Can you test the getVisibleUsers query? Does it return the expected users?


The Chat windows in the middle of the screen is because the software who make the caption take the entire page,is not a bug.  Let me send this information first

Have you used the correct "Test Inputs" ? For which user did you test?
I'm having the same issue as Pedro, I have no role visibility restrictions, but only Administrator shows up in the contact list.

When I test that query in servicecenter, I get an invalid cast error:

However, when I test the query in Sql Server Management Studio, I do get a list of all the enabled users back, as I should. 

Any ideas?
Hi Corey,

The first thing I would ask you to do is to restart the node.js server after setting all the users and permissions.

If this doesn't solve your problem, can you do the following? 

 - start the node.js this way:
 node.exe server.js > output.txt
- open a page with chat logged as the Administrator 
- open a page with chat logged as other user
- stop node.js
- send me the generated output.txt file

Are you running this App on a Personal environment or on an Enterprise environment?
I couldn't replicate this issue on my side and I may need access to it to proceed with the troubleshooting.

Thanks (and sorry for all those problems),


Still having the issue.

I've attached the output file

We're running the app in our enterprise environment. Unfortunately I don't think I'll be able to give you access, but I'll be happy to try anything else to troubleshoot the issue.
Hi Corey,

From what I've seen:

Your first log in was with the administrator, and you only received your contact  information:

debug: websocket writing 5:::{"name":"ContactsInfo","args":[{"MyInfo":{"name":"Administrator","id":" <ADMINHASH> ","picHash":" ... ","status":0,"disabled":false,"blocked":[]}}]}

Then you accessed with a different user, and you only have your own information and the Administrator's.

debug: websocket writing 5:::{"name":"ContactsInfo","args":[{"MyInfo":{"name":"Sales Rep Region 1","id":"...","picHash":"...","status":0,"disabled":false,"blocked":[]},"<ADMINHASH>":{"name":"Administrator","status":0,"picHash":"..."}}]}

From the contact name... "Sales Rep Region 1", I'm assuming that you might have multi tenant in your server. Am I right?

Unfortunatelly the code is not ready for multi tenant. The problem is really the source query that might need to get users from all tenants.


There are multiple tenants configured on the server, but the application I am trying to use chat with is not multi-tenant. All of the users in question are in the default (Users) Tenant.
Can you try this change on the Chat module?

Then publish Chat and access it again with both users.

Just to make sure this isn't a tenant issue :)

I actually figured out the issue. It had nothing to do with Tenants.

I looked in the database and it seems I had published an older version of Chat in the past which had a different espace ID, and so the GetChatParticipantRole query was finding the ChatParticipant Role from the old version instead of the correct role record from the new version.
I deleted the old role record and it's working now.  Also adding an additional criteria to the query to match the espace ID of the role probably would have fixed it too.
Great catch! :)

I think this is the same issue Pedro has.
I try to fix this situation ASAP with the info you provided.