You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The output of a speedtest is being store in results.data in the incorrect format. The field contains escaping characters \ and new lines \n which breaks Laravel's model casting from working correctly.
To Reproduce
Steps to reproduce the behavior:
Go to the dashboard
Click on "Queue Speedtest" and wait for it to run
Open a database IDE and browse the table results
See incorrectly formatted json
Expected behavior
Modify app/Jobs/ExecSpeedtest.php to correctly store the results received by the speedtest-cli.
Result::create([
//...'data' => $output, // <- change this'data' => $results, // <- to this and let Laravel convert the array automatically.
]);
Screenshots
The last row of this screenshot has the correct data format when using the decoded $output value from $results.
Additional Context
This has been the root cause of a lot of the other issues and the model attribute casting not working. The issue keeps cropping up when passing data to InfluxDB.
Things that will break
InfluxDb integration
Dashboard charts
Results table
Legacy APIs
tbd...
Databases to test
sqlite
mysql/mariadb
postgresql
Steps to fix the issue
Option 1 - iterate through each record and re-encode it.
If that's the only main data issue we have, an automatic routine that runs at startup, that sanity checks the results table and if it finds wrong characters updates all records would be a good solution.
Otherwise, we could introduce a new Maintenance menu, and let users run the task.
Describe the bug
The output of a speedtest is being store in
results.data
in the incorrect format. The field contains escaping characters\
and new lines\n
which breaks Laravel's model casting from working correctly.To Reproduce
Steps to reproduce the behavior:
results
Expected behavior
Modify
app/Jobs/ExecSpeedtest.php
to correctly store the results received by the speedtest-cli.Screenshots
The last row of this screenshot has the correct data format when using the decoded
$output
value from$results
.Additional Context
This has been the root cause of a lot of the other issues and the model attribute casting not working. The issue keeps cropping up when passing data to InfluxDB.
Things that will break
Databases to test
Steps to fix the issue
Option 1 - iterate through each record and re-encode it.
Option x - tbd...
The text was updated successfully, but these errors were encountered: