Commit 9cd6593
authored
Follow up PR to #2531
which failed testing, with an error from `JSON.stringify()` of
`RangeError: Invalid string length`.
These errors are caused by linked structures such as a Java
LinkedHashMap that's included in the Redux data in various API related
keys. We use the blacklist to filter out keys containing these
structures, but these keys are not stable and will need to be constantly
updated to prevent the log export from outright failing.
To preemptively deal with this, the maximum depth to serialize to can be
limited in the
[safe-stable-stringify](https://www.npmjs.com/package/safe-stable-stringify)
library to avoid linked structures from blowing up the log size. With no
blacklist entries, the exported log size is only `1.2MB`.
With an updated blacklist, exporting the logs with or without the limit
both yield log files of almost the exact same size, meaning that no
useful data has been lost by limiting the depth. However, I'm open to
suggestions to the default depth to serialize to, or whether it should
be optional to have a limit on the depth instead of mandating a limit
(`Infinity` is not accepted by the library).
1 parent a19bc11 commit 9cd6593
2 files changed
Lines changed: 48 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
175 | 198 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
17 | 20 | | |
| 21 | + | |
18 | 22 | | |
19 | | - | |
| 23 | + | |
| 24 | + | |
20 | 25 | | |
21 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
22 | 30 | | |
23 | 31 | | |
24 | 32 | | |
| |||
63 | 71 | | |
64 | 72 | | |
65 | 73 | | |
66 | | - | |
| 74 | + | |
| 75 | + | |
67 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
68 | 83 | | |
69 | 84 | | |
70 | 85 | | |
| |||
102 | 117 | | |
103 | 118 | | |
104 | 119 | | |
| 120 | + | |
105 | 121 | | |
106 | 122 | | |
107 | 123 | | |
108 | 124 | | |
109 | 125 | | |
110 | 126 | | |
111 | 127 | | |
112 | | - | |
| 128 | + | |
| 129 | + | |
113 | 130 | | |
114 | 131 | | |
115 | 132 | | |
| |||
118 | 135 | | |
119 | 136 | | |
120 | 137 | | |
121 | | - | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
122 | 142 | | |
123 | 143 | | |
124 | 144 | | |
| |||
0 commit comments