This question probably has no answer. But I thought that I would do it. I wrote a great one-page application. When the application starts, the open tab is "registered" itself with the server, which is stored as the "active" tab.
If user A changes XYZ in the workspace, each tab opened in this workspace by any user receives a notification that XYZ has been changed. This causes a reboot in the clients, which will be magically updated. At the moment, I am doing this through a survey. However, when all this works, I can use things like WS or Socket.io to make things even faster.
PROBLEM: Each tab receives a notification. Even the tab that initiated it first! (as a result, the updated screen is updated)
For some reason, I need a server to find out the bookmark ID of the tab that makes the request. Remember that the user can open 5 tabs: if they change XYZ, all tabs should receive a notification, EXCEPT for what really caused it.
I am currently passing the workspace identifier for each Ajax request (a user can log in and have access to multiple workspaces at the same time).
- Solution 1: Add a workspace id and tab id for each request.
- Solution 2: use only the tab identifier for each request. The application will develop a workspace identifier from tabID (which knows which workspace it belongs to)
- Solution 3: (Something I miss?)
Any ideas?
source share