Commit 891a44e
authored
fix(tracing): Better guarding for performance observer (#8872)
This removes a type cast for the performance observer and actually adds
some guards to make sure we do not run into cases where a property we
expect to exist does not exist.
It seems we sometimes ran into cases where `nextHopProtocol` would be
`undefined`, not a string, leading to
https://github.com/getsentry/sentry-javascript/blob/develop/packages/tracing-internal/src/browser/request.ts#L202
failing.
I now specifically check for the existence of this property, as well as
also adding a default for all the time based stuff (0) to ensure these
also work in the case one of the fields does not exist (instead of
checking for existence of all of them).
Closes #8870
Closes #88631 parent 81efb87 commit 891a44e
1 file changed
+12
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
169 | 178 | | |
170 | 179 | | |
171 | 180 | | |
| |||
175 | 184 | | |
176 | 185 | | |
177 | 186 | | |
178 | | - | |
| 187 | + | |
179 | 188 | | |
180 | | - | |
| 189 | + | |
181 | 190 | | |
182 | 191 | | |
183 | 192 | | |
| |||
220 | 229 | | |
221 | 230 | | |
222 | 231 | | |
223 | | - | |
| 232 | + | |
224 | 233 | | |
225 | 234 | | |
226 | 235 | | |
| |||
0 commit comments