Commit Graph

61 Commits (8cae2fa0aafb22b44bdcb75d0e5757c30eab06da)

Author SHA1 Message Date
David Baker a15c8fd476 Only limit the rageshake log size in one place
We had two different places in the code that were both trying to
limit to the MAX_LOG_SIZE and doing different things with it.
fetchLogs was keeping each individual file to MAX_LOG_SIZE but then
the outer loop was also discarding the whole file if it would make
the total exceed MAX_LOG_SIZE. This meant that if you ran your client
for a while then refreshed and sent a rageshake, the logic would
omit everything from before the refresh but make sure it included the
tiny amount of useless logging from after the refresh.

This will truncate large files if they would take the whole thing
over the size limit and still include part of them.
2019-10-04 14:56:46 +01:00
David Baker 796f5746db Truncate debug logs at the start, not the end
We left out later parts if we exceeded the maximum log size, which
was deeply unhelpful since the problem almost certainly happened
just before the user hit the 'submit debug logs' button.

Instead, iterate backwards through the fragments and prepend them,
leaving off the earlier ones if we run over the size.

Also, check we're not going to run over the size before adding
the fragment so we might actually stick to the maximum log size.

May fix https://github.com/vector-im/riot-web/issues/10951
2019-09-26 18:46:19 +01:00
Jason Robinson f505aa0c83 Ensure logging tweak doesn't fail on undefined
Run the replace on the log line string instead of the separate
parts since we can ensure the line is a string.

Signed-off-by: Jason Robinson <jasonr@matrix.org>
2019-08-23 10:14:26 +03:00
Jason Robinson 8c73056693 Tweak rageshake logging messages
Signed-off-by: Jason Robinson <jasonr@matrix.org>
2019-08-21 16:06:32 +03:00
Travis Ralston e1f26059a7 Convert objects and such to usable strings in rageshake
Fixes https://github.com/vector-im/riot-web/issues/7844
2019-03-01 09:58:54 -07:00
David Baker 259d3608ee Make rageshake use less memory
If an individual log is larger than the max size, ignore the rest
of it. Also build the string as we go rather than joining it all
together at the end, that way we only need the whole string + one
chunk in memory at once, rather than the whole string x 2.
2018-10-15 15:23:44 +01:00
Aaron Raimist 752d816780
Fix some more lint errors
Signed-off-by: Aaron Raimist <aaron@raim.ist>
2018-10-11 22:06:01 -05:00
Aaron Raimist c83521bb31
Fix lint errors in rageshake.js
Signed-off-by: Aaron Raimist <aaron@raim.ist>
2018-10-11 21:58:22 -05:00
Bruno Windels 14b040e6a6 log correct error code when opening log idb 2018-10-08 15:14:03 +02:00
David Baker 3ea5fc9185 Fix rageshake
aka. Module Variables Are Not Global Variables pt. 319
2018-04-20 14:06:09 +01:00
Matthew Hodgson efe466ef75 move rageshake to sdk 2018-04-13 01:34:16 +01:00