TraceKit icon indicating copy to clipboard operation
TraceKit copied to clipboard

Extremely long delays on errors with a long message

Open rgehan opened this issue 5 years ago • 4 comments

I'm using mobx-state-tree, which generates very long error messages, when trying to instantiate a model with data that doesn't match the defined schema.

It appends a full dump of the the data to the message, among other things.

I've seen it generate a 300kB message from a 10kB JSON payload.

The issue seems to originate from a RegExp which is ran on each line of the stacktrace (which includes the message).

rgehan avatar Oct 23 '19 14:10 rgehan

Perhaps we only run the Regex if the string length is reasonable?

Sent from my iPhone

On Oct 23, 2019, at 9:54 AM, Renan GEHAN [email protected] wrote:

 I'm using mobx-state-tree, which generates very long error messages, when trying to instantiate a model with data that doesn't match the defined schema.

It appends a full dump of the the data to the message, among other things.

I've seen it generate a 300kB message from a 10kB JSON payload.

When calling Sentry.captureException(error), I notice delays around ~90s.

The issue seems to originate from a RegExp which is ran on each line of the stacktrace (which includes the message).

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

niemyjski avatar Oct 23 '19 16:10 niemyjski

Couldn't we remove the "message" from the "stacktrace" so as to only keep the actual stack trace part of it?

This is a naive suggestion, as I don't know all the possible formats or use cases.

Like running the regexp on stack.slice(ex.message.length)

rgehan avatar Oct 23 '19 18:10 rgehan

I'd think we would always want it because sometimes that's the only thing we have. I'm not sure if we should supply a callback to modify it or limit the regex. I think we may want to optimize the regex and limit the string length of what we are parsing?

On Wed, Oct 23, 2019 at 1:05 PM Renan GEHAN [email protected] wrote:

Couldn't we remove the "message" from the "stacktrace" so as to only keep the actual stack trace part of it?

This is a naive suggestion, as I don't know all the possible formats or use cases.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/csnover/TraceKit/issues/76?email_source=notifications&email_token=AAHZFI2ONF3CWHFN4CVWVRTQQCHAJA5CNFSM4JEC4AM2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECCLDFY#issuecomment-545567127, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHZFI5ROMCLXJ37HRUM5CTQQCHAJANCNFSM4JEC4AMQ .

niemyjski avatar Oct 23 '19 18:10 niemyjski

can you submit apr for this?

niemyjski avatar Apr 08 '20 13:04 niemyjski