Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace user other with data #2258

Conversation

adinauer
Copy link
Member

@adinauer adinauer commented Sep 26, 2022

馃摐 Description

data is now used instead of other on User. Can still parse other from JSON but will move it to data.

This way the custom properties will show up the same way in the UI as they do on other SDKs (e.g. JS).

馃挕 Motivation and Context

Closes #2242

馃挌 How did you test it?

馃摑 Checklist

  • I reviewed the submitted code
  • I added tests to verify the changes
  • I updated the docs if needed
  • No breaking changes

馃敭 Next steps

@github-actions
Copy link
Contributor

github-actions bot commented Sep 26, 2022

Messages
馃摉 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 馃毇 dangerJS against b209771

@github-actions
Copy link
Contributor

github-actions bot commented Sep 26, 2022

Performance metrics 馃殌

Plain With Sentry Diff
Startup time 304.30 ms 344.04 ms 39.74 ms
Size 1.74 MiB 2.33 MiB 605.65 KiB

Baseline results on branch: feat/make-user-segment-top-level-property

Startup times

Revision Plain With Sentry Diff
c7dc7e4 357.37 ms 402.27 ms 44.90 ms

App size

Revision Plain With Sentry Diff
c7dc7e4 1.74 MiB 2.33 MiB 605.55 KiB

Previous results on branch: feat/move-user-other-to-data

Startup times

Revision Plain With Sentry Diff
7cd0ea5 274.55 ms 320.37 ms 45.82 ms
e790300 354.43 ms 389.29 ms 34.86 ms
3225bfd 297.04 ms 358.67 ms 61.63 ms

App size

Revision Plain With Sentry Diff
7cd0ea5 1.74 MiB 2.33 MiB 605.65 KiB
e790300 1.74 MiB 2.33 MiB 605.65 KiB
3225bfd 1.74 MiB 2.33 MiB 605.65 KiB

Copy link
Member

@philipphofmann philipphofmann left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -0,0 +1,10 @@
{
"email": "c4d61c1b-c144-431e-868f-37a46be5e5f2",
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for adding this 馃憦

@@ -43,6 +43,15 @@ class UserSerializationTest {
assertEquals(expectedJson, actualJson)
}

@Test
fun deserializeLegacy() {
Copy link
Member

Choose a reason for hiding this comment

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

馃憤 for adding a test for this.

CollectionUtils.newConcurrentHashMap(
(Map<String, String>) reader.nextObjectOrNull());
break;
case JsonKeys.OTHER:
Copy link
Member

Choose a reason for hiding this comment

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

l: Maybe a short comment on why we still have this?

Copy link
Member Author

Choose a reason for hiding this comment

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

added

CHANGELOG.md Outdated
@@ -5,6 +5,7 @@
### Features

- Make user segment a top level property ([#2257](https://github.com/getsentry/sentry-java/pull/2257))
- Make user segment a top level property ([#2258](https://github.com/getsentry/sentry-java/pull/2258))
Copy link
Contributor

Choose a reason for hiding this comment

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

PR title and changelog seem to be off, this is not about the user.segment.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh wow good catch thanks! Not sure how that happened. Guess I just rely on the auto generated title too much and in this case it used the title from the PR I want to merge into.

@@ -150,19 +150,43 @@ public void setIpAddress(final @Nullable String ipAddress) {
/**
* Gets other user related data.
*
* @deprecated use getData instead
Copy link
Contributor

Choose a reason for hiding this comment

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

You can use the @link javadocs
Eg {{@link SentryOptions#getShutdownTimeoutMillis()} }

Copy link
Member Author

Choose a reason for hiding this comment

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

updated

@@ -43,6 +43,15 @@ class UserSerializationTest {
assertEquals(expectedJson, actualJson)
}

@Test
fun deserializeLegacy() {
Copy link
Contributor

Choose a reason for hiding this comment

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

You can use backticks and call it deserialize legacy

Copy link
Member Author

Choose a reason for hiding this comment

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

updated

@adinauer adinauer changed the title Make user segment a top level property Replace user other with data Sep 27, 2022
@adinauer adinauer merged commit 6187196 into feat/make-user-segment-top-level-property Sep 27, 2022
@adinauer adinauer deleted the feat/move-user-other-to-data branch September 27, 2022 06:33
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.

None yet

3 participants