On socket connection, the client will send a userId message, which we then use to create two mappings in Redis:
1) socket.id -> userId, which allows us to efficiently determine which user is sending messages
2) userId -> socket.id, which allows us to efficiently determine which user to send messages to
On friend updates, we retrieve userId and/or friendId from redis to update the frontend.
This is also done for job sharing.
Note: Due to the dependency on Redis, backend tests now must be run in docker, unless you manually start redis.
This adds socketio to the backend.
On socket connection, the client will send a userId message, which we then use to create two mappings in Redis: 1)
socket.id -> userId
, which allows us to efficiently determine which user is sending messages 2)userId -> socket.id
, which allows us to efficiently determine which user to send messages toOn friend updates, we retrieve userId and/or friendId from redis to update the frontend. This is also done for job sharing.
Note: Due to the dependency on Redis, backend tests now must be run in docker, unless you manually start redis.