Dynmap sometimes "forgets" to update region markers
Brokkonaut opened this issue ยท 1 comments
Issue Description: When the dynmap browser tab is in the background for some time and the server updates region markers they are never sent to the client and so they are not updated.
- Dynmap Version: 3.7-SNAPSHOT-936
- Server Version: Paper 1.20.4 build 950b736
- Steps to Replicate:
- Open the Dynmap in the browser, send the tab to the background
- Modify a marker on the server
- Wait more than 2 minutes (this is important)
- Now look at the dynmap in the browser, the marker will not update
- Cause and possible solutions:
- In UpdateQueue.java there is a timeout
maxUpdateAge = 120000
that causes updates to be discarded on the server side after 2 minutes, but the client does not request updates when the tab is in the background (map.js, line 614if (document.visibilityState === "hidden") { ...
) - So when it tries to update after more than 2 minutes the updates are lost and the client does not update. - I thought about solutions and found 3 options:
- Increase the discard timeout on the server to a much larger value (like 24 hours or configurable), so updates will only be lost if a tab is inactive for a very long time
- Do not skip the updates in map.js or
- Increase the timeout on the server to some medium high value (maybe 35 minutes?) and to not skip the update on the client side all 30 minutes even if the tab is in background
- In UpdateQueue.java there is a timeout
[x] I have looked at all other issues and this is not a duplicate
[x] I have been able to replicate this