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

fix: Use proper application state before sending an event #4005

Merged
merged 4 commits into from
May 23, 2024

Conversation

bguidolim
Copy link
Contributor

📜 Description

Replaced source of truth for app state from SentryAppStateManager instance to SentryUIApplication.

💡 Motivation and Context

This change is required since it's sending wrong value to for all events in an UIKit application.
This PR fixes #3991

💚 How did you test it?

Existing unit tests pass

📝 Checklist

You have to check all boxes before merging:

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

@bguidolim bguidolim marked this pull request as ready for review May 22, 2024 13:53
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.

Thanks a lot, @bguidolim. Please add some tests in SentryClient for that. Then we can merge this.

Copy link

codecov bot commented May 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.889%. Comparing base (b11cd87) to head (cfb9197).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #4005       +/-   ##
=============================================
+ Coverage   90.863%   90.889%   +0.025%     
=============================================
  Files          593       594        +1     
  Lines        46506     46647      +141     
  Branches     16624     16688       +64     
=============================================
+ Hits         42257     42397      +140     
- Misses        4067      4069        +2     
+ Partials       182       181        -1     
Files Coverage Δ
Sources/Sentry/SentryClient.m 98.341% <100.000%> (+2.369%) ⬆️
Tests/SentryTests/SentryClientTests.swift 97.444% <100.000%> (+0.090%) ⬆️

... and 16 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b11cd87...cfb9197. Read the comment docs.

@bguidolim
Copy link
Contributor Author

Hey @philipphofmann

Do I need to do something regarding the failed checks?
It seems it's out of my control.

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, thanks 💯

@philipphofmann
Copy link
Member

Do I need to do something regarding the failed checks? It seems it's out of my control.

No action is required. That's out of your control.

@philipphofmann philipphofmann merged commit ed49f0c into getsentry:main May 23, 2024
63 of 67 checks passed
@bguidolim bguidolim deleted the fix-app-state branch May 23, 2024 14:59
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.

Wrong value in "In Foreground" for every sentry event
2 participants