websocket send position of devices that there is another user.

amina month ago

i have a problem.i have two users of traccar on one server.in my user websocket sends positions of devices that there are in another user.

Kaloyan Kaneva month ago

It's only websocket or you have it and in devices list? The information is not enough, share some screenshots

amina month ago

its only websocket.when device send data

Anton Tananaeva month ago

Standard Traccar will only send WebSocket updates for devices that the current user has access to. So either you're not using an official version or you're doing something wrong.

amina month ago

i use version 5.12 i think there is something wrong here: in method public synchronized void updateDevice:
https://github.com/traccar/traccar/blob/master/src/main/java/org/traccar/session/ConnectionManager.java

Anton Tananaeva month ago

Highly unlikely. Someone would have noticed it by now.

amina month ago

when i debug in this for loop: for (long userId : deviceUsers.getOrDefault(device.getId(), Collections.emptySet()))
there is something wrong. for example i have a device with id 420 that belongs to user with id 12.but when invoke deviceUsers.getOrDefault(device.getId(), Collections.emptySet() with deviceid=12 we got userid=1;

amina month ago

deviceUsers.getOrDefault(device.getId(), Collections.emptySet()) this method returns all other users stay log in addition to that user belong to online device.you can test it.

amina month ago

anton im sorry.there was problem in my source code

Anton Tananaeva month ago

Exactly what I suspected. In the future if you ask for help on this forum, please clearly specify upfront that you're not using an official version of Traccar and have custom code instead. But I appreciate that you at least admitted it. Most people in a similar situation will just stop posting and never admit that the issue was in their customization.

amina month ago

thank you very much.