eckhchri / pcars-ds-liveview

Provides a html page for project cars dedicated server and display a map of the current race.
14 stars 1 forks source link

liveview resetting sporadically #115

Open viper4gh opened 6 years ago

viper4gh commented 6 years ago

Sometimes the liveview is crashing/resetting, In Result all dynamic determined data during a race weekend is reset, too. This affects the pit stop counting, the collected session results for the "Export All" Button and the race gap calculation. Cause is unknown at the moment.

viper4gh commented 6 years ago

An indication maybe is a corrupted or missing data packet from DS. Sometimes the Chrome console shows the following error: problem_liveview resets_consolelog

A recording is not stopped by such a reset, which means that not the complete website is reloaded. When the reset happens the recorded file shows the default init values in this one moment: reset_rec.txt

viper4gh commented 6 years ago

One or more datasets with default values during a running session, because of failed DS API requests, will have a bad impact on all used triggers for SessionState and SessionStage changes.

All triggers have to be checked again and not only the triggers which reset the pit stop and gap data array.

viper4gh commented 6 years ago

Tested a 20 Lap Race @ Sugo with 32 drivers. The resets/crashs happened again, but the gaps and number of pits have not been lost. The fix seems to work.

viper4gh commented 6 years ago

The console log from the Chrome developer tools shows the following:

x.x.x.x:9009/api/session/status?attributes&members&participants:1 GET http://x.x.x.x:9009/api/session/status?attributes&members&participants net::ERR_CONTENT_LENGTH_MISMATCH

receive_ds_data.js:222 Error while sending Request to DS!:NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'http://x.x.x.x:9009/api/session/status?attributes&members&participants'.

viper4gh commented 6 years ago

Some infos about the Chrome error: https://gist.github.com/voronianski/791ef517c5392d7ce5fb

viper4gh commented 6 years ago

Check replacing XMLHttpRequest by fetch: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API