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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(sdk): Add in_foreground to event app context #2826

Merged
merged 7 commits into from
Feb 23, 2023

Conversation

krystofwoldrich
Copy link
Member

@krystofwoldrich krystofwoldrich commented Feb 13, 2023

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

💡 Motivation and Context

💚 How did you test it?

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled
  • All tests passing
  • No breaking changes

🔮 Next steps

@github-actions
Copy link
Contributor

github-actions bot commented Feb 13, 2023

Android (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 349.39 ms 359.20 ms 9.82 ms
Size 17.73 MiB 20.04 MiB 2.31 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
86d6d2c+dirty 332.90 ms 352.45 ms 19.55 ms
d197b5c+dirty 338.94 ms 354.87 ms 15.93 ms

App size

Revision Plain With Sentry Diff
86d6d2c+dirty 17.73 MiB 20.04 MiB 2.31 MiB
d197b5c+dirty 17.73 MiB 20.04 MiB 2.31 MiB

@github-actions
Copy link
Contributor

github-actions bot commented Feb 13, 2023

iOS (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1260.00 ms 1272.48 ms 12.48 ms
Size 2.36 MiB 2.82 MiB 462.87 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
86d6d2c+dirty 1267.55 ms 1286.21 ms 18.66 ms
d197b5c+dirty 1217.61 ms 1242.66 ms 25.05 ms

App size

Revision Plain With Sentry Diff
86d6d2c+dirty 2.36 MiB 2.82 MiB 462.82 KiB
d197b5c+dirty 2.36 MiB 2.82 MiB 462.86 KiB

@github-actions
Copy link
Contributor

github-actions bot commented Feb 13, 2023

Android (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 288.49 ms 355.73 ms 67.24 ms
Size 7.15 MiB 8.09 MiB 962.83 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
86d6d2c+dirty 267.21 ms 325.24 ms 58.04 ms
d197b5c+dirty 258.75 ms 313.61 ms 54.86 ms

App size

Revision Plain With Sentry Diff
86d6d2c+dirty 7.15 MiB 8.09 MiB 962.69 KiB
d197b5c+dirty 7.15 MiB 8.09 MiB 962.72 KiB

@krystofwoldrich krystofwoldrich marked this pull request as ready for review February 15, 2023 12:04
@github-actions
Copy link
Contributor

iOS (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1265.08 ms 1266.11 ms 1.03 ms
Size 2.92 MiB 3.37 MiB 464.11 KiB

Baseline results on branch: 5.0.0

Startup times

Revision Plain With Sentry Diff
d760caf+dirty 1258.76 ms 1292.66 ms 33.90 ms
b868b53+dirty 1253.68 ms 1253.94 ms 0.26 ms
d091239+dirty 1261.62 ms 1275.80 ms 14.17 ms
58ae930+dirty 1266.80 ms 1273.79 ms 6.99 ms
34dc259+dirty 1283.72 ms 1289.30 ms 5.58 ms

App size

Revision Plain With Sentry Diff
d760caf+dirty 2.92 MiB 3.37 MiB 462.90 KiB
b868b53+dirty 2.92 MiB 3.30 MiB 387.19 KiB
d091239+dirty 2.92 MiB 3.30 MiB 387.22 KiB
58ae930+dirty 2.92 MiB 3.37 MiB 464.04 KiB
34dc259+dirty 2.92 MiB 3.37 MiB 463.96 KiB

nativeContext = nativeContext || {};
nativeContext.app = {
...nativeContext.app,
in_foreground: AppState.currentState === 'active',

Choose a reason for hiding this comment

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

Doesn't it need to be set to "false" at some point too? Or are you passing the nativeContext to the native SDKs and they set it for you?

Copy link
Member Author

Choose a reason for hiding this comment

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

The in_foreground is merged into what I get from native SDKs. As I think the value that RN reports is important for RN devs.

If the AppState.currentState === 'active' => true, else false.

Thanks for the comment I've added a test to make it clear how it works.

Choose a reason for hiding this comment

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

Ahh, I see now, gotcha. Thanks!

Copy link

@bitsandfoxes bitsandfoxes left a comment

Choose a reason for hiding this comment

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

Awesome!

Base automatically changed from 5.0.0 to main February 21, 2023 12:15
@krystofwoldrich krystofwoldrich changed the title Add app in_foreground from rn api feat(sdk): Add in_foreground to event app context Feb 23, 2023
@krystofwoldrich krystofwoldrich enabled auto-merge (squash) February 23, 2023 12:57
@github-actions
Copy link
Contributor

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

Generated by 🚫 dangerJS against 0f0745c

@krystofwoldrich krystofwoldrich merged commit 9a3ca65 into main Feb 23, 2023
@krystofwoldrich krystofwoldrich deleted the kw-app-in-foreground branch February 23, 2023 13:07
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.

3 participants