Skip to content

Conversation

@wilkomanger
Copy link
Contributor

No description provided.

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@wilkomanger
Copy link
Contributor Author

Signed the CLA!

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@SammyO
Copy link

SammyO commented Sep 9, 2019

Any update on this? Would be great to get this merged.

Copy link
Contributor

@yjbanov yjbanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change also requires tests.

lib/sentry.dart Outdated
break;
}

if (name != null) json['name'] = name;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency let's use { } block syntax everywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure? I was doing this because this is done in existing code already for serialization. So it would be less consistent with existing code, if you look at Event.toJson for example.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was looking around line 758. More generally Flutter style guide wants to do this: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#separate-the-if-expression-from-its-statement. The easiest way to make that work with dartfmt is to use braces.

However, this repo has been pretty lax about style, so I do not insist.

@yjbanov
Copy link
Contributor

yjbanov commented Sep 11, 2019

Sorry for the delay. If you are still interested in making this change, I'm around to review it. Thanks for the contribution!

@wilkomanger
Copy link
Contributor Author

Cool, will take a look at the suggestions!

@yjbanov
Copy link
Contributor

yjbanov commented Sep 25, 2019

@wilkomanger Are you still interested in merging this PR? The changes LGTM. It just needs some unit tests and it should be good to go.

@wilkomanger
Copy link
Contributor Author

Yes, I will do that next week!

@maks
Copy link
Contributor

maks commented Oct 10, 2019

Would it be possible to allow passing a context into captureException() ?
This would allow reporting the current state of things like battery, freeMemory, etc at the time of error instead of in environmentAttributes which is when the client is created.

@maks
Copy link
Contributor

maks commented Dec 18, 2019

@wilkomanger would you still able to update this PR and add unit tests?
I'm currently using your fork but would prefer to use a published release version of this package for production app.

@maks
Copy link
Contributor

maks commented Jan 8, 2020

@wilkomanger if you don't have time to work on it right now, I can have a go at getting this PR rebased and adding some unit tests for it?

@wilkomanger
Copy link
Contributor Author

wilkomanger commented Jan 9, 2020

@maks That'd be great, thanks! Maybe PR it to my fork and then I can let this PR get approved with the tests?

@wilkomanger
Copy link
Contributor Author

Would it be possible to allow passing a context into captureException() ?
This would allow reporting the current state of things like battery, freeMemory, etc at the time of error instead of in environmentAttributes which is when the client is created.

Maybe you could do that after this PR is merged in a separate one, if it's possible

@wilkomanger
Copy link
Contributor Author

wilkomanger commented Jan 9, 2020

And sorry about the delay everyone, I was/am kinda busy and forgot about it!

@maks
Copy link
Contributor

maks commented Jan 9, 2020

👍 @wilkomanger I'll get to work on that and raise PR against your repo.

@maks
Copy link
Contributor

maks commented Jan 10, 2020

@wilkomanger ok done, I've got a PR against the branch in your repo: wilkomanger#1

that gets it up to date with master from here and adds a test for the json generated (simliar to what events test).

There was alot for code churn here when the web support PR got merged, so the change is actually against the base file now.

Contexts update to upstream, add test, bugfixes
@googlebot
Copy link

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@wilkomanger
Copy link
Contributor Author

@maks Thank you!

@maks
Copy link
Contributor

maks commented Jan 10, 2020

@googlebot I consent.

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@maks
Copy link
Contributor

maks commented Jan 20, 2020

@yjbanov is there any thing else that is needed to get this merged?

@yjbanov
Copy link
Contributor

yjbanov commented Jan 21, 2020

@yjbanov is there any thing else that is needed to get this merged?

Is this ready for review? LMK and I'll do another pass.

@maks
Copy link
Contributor

maks commented Jan 21, 2020

@yjbanov thanks! Yes please, its ready for another review now.

Copy link
Contributor

@yjbanov yjbanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks pretty clean! I only have one small nitpick for the test.

Other than that, let's update CHANGELOG.md, bump the version to 3.0.1, and it's good to go. Thanks!

final testApp = App(version: '1.2.3');
final testBrowser = Browser(version: '12.3.4');

final contexts = Contexts(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's put this in an Event instance, then call event.toJson() and expect(eventJson['contexts'], ...);. This will also test the logic in Event.toJson().

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yjbanov test improved, changelog updated and version bumped in latest commit.

Copy link
Member

@bruno-garcia bruno-garcia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice to see this landing in the Dart sdk

}
}

json[key] = runtime.toJson()..addAll({"type": "runtime"});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious if this runtime list approach exists on another Sentry SDK and if yes which one?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure, I made it so that in theory you don't have to specify keys or can even specify conflicting ones, from what I remember.

this.freeStorage,
this.externalStorageSize,
this.externalFreeStorage,
this.bootTime,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We recently added some new fields which I Don't think made it to the docs yet. Not at the computer right now but I can check later and make a PR.


if (modelId != null) json['model_id'] = modelId;

if (arch != null) json['arch'] = arch;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We added archs too now for devices with more than one cpu

@maks
Copy link
Contributor

maks commented Jan 22, 2020

Thanks @bruno-garcia,I'd be happy to do those in a followup PR as I'm quite keen to get this one merged first if possible.
@wilkomanger I've made the changes requested by @yjbanov in wilkomanger#3
if you get a chance to merge that into your branch then hopefully this PR is then ready to merge here.

wilkomanger and others added 3 commits January 23, 2020 20:29
@yjbanov
Copy link
Contributor

yjbanov commented Jan 24, 2020

Awesome! Thank you! Merging and will publish the new version to pub shortly.

@yjbanov yjbanov merged commit 116e4a7 into getsentry:master Jan 24, 2020
final String screenResolution;

/// A floating point denoting the screen density.
final String screenDensity;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has to be a double. I get the following error from Sentry:

There was 1 error encountered while processing this event
contexts.device.screen_density: Discarded invalid value

Reason expected a floating point number
Value 2.625

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Just reviewed the docs and it says:

Optional. A floating point denoting the screen density.

I'll review the types and open a PR to fix this

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Also filed flutter/flutter#53521.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants