-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Read projectPackages array when serialising error reports #451
Conversation
The project packages should be read when serialised from a native error report, as it could change from the time when an error was originally reported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't test out the implementation – I'd need some guidance to put together steps to reproduce if we want to do that. I read and looked through the code in great detail and have made some remarks on the changes I saw.
I think if we zoom out a bit as well, this seems like an overly complex change in order to fix quite a trivial bug. I do understand that you're working within the constraints of what's already in the codebase so it's not a citique on the implementation, more that I want to widen the discussion a little.
I think a whole load of complexity could be removed if the stackframes were marked as inProject = true|false
before being serialised, then you don't have to worry about passing around this configuration option, adding getters/setters in multiple places, serialising and deserialising it, only to do a calculation that could have been done way sooner.
I'm assuming that kind of change would be beyond the scope of this piece of work and would be tackled in a larger re-architecture, but I wanted to get your thoughts on it anyway.
After in-person discussion I believe that adding As I've addressed the remaining feedback I believe this is ready for re-review. |
Goal
It is currently possible to call
Bugsnag.setProjectPackages
after bugsnag has been initialsed, although for nearly all conceivable usecases this value won't change in the lifetime of an application. For example:The
Bugsnag
andClient
accessors have been deprecated in favour of setting this value on theConfiguration
object, and passing that in as a constructor parameter to theClient
. Additionally, theErrorReader
class has been altered so that the correctprojectPackages
value is now used.Changeset
projectPackages
accessors onBugsnag
andClient
in favour ofConfiguration
inProject()
toStacktrace
as only used thereprojectPackages
field toStacktrace
that is used for in-project calculationsErrorReader
serialisation methods generic with casts so caller can use typing properlyTests
Manually tested
Followed the steps in #418 to confirm that the
projectPackages
is now correctly set when manually inspecting the payload. Also relied on existing unit tests.