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: Window.FEATURE_NO_TITLE does not work when using activity traces #1769

Merged
merged 5 commits into from
Oct 18, 2021

Conversation

marandaneto
Copy link
Contributor

@marandaneto marandaneto commented Oct 18, 2021

📜 Description

Fix: Window.FEATURE_NO_TITLE does not work when using activity traces

💡 Motivation and Context

Fixes #1768

💚 How did you test it?

running sample with dialog, checking no title bar and also checking slow/frozen frames on Sentry UI

📝 Checklist

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

🔮 Next steps

@marandaneto marandaneto changed the title changelog Fix: Window.FEATURE_NO_TITLE does not work when using activity traces Oct 18, 2021
@marandaneto marandaneto requested a review from a team October 18, 2021 09:00
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.

I don't understand why moving the call to addActivity from onActivityCreated to onActivityStarted fixes the problem. Can you please elaborate on why this fixes the problem and add this info as a comment? The docs of FrameMetricsAggregator#add don't contain any information around this.

Ideally, we would have a UI test reproducing this issue, but I guess that is a bit complicated to achieve?

@codecov-commenter
Copy link

codecov-commenter commented Oct 18, 2021

Codecov Report

Merging #1769 (2c2b4e3) into main (b2eb278) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##               main    #1769   +/-   ##
=========================================
  Coverage     75.31%   75.31%           
  Complexity     2165     2165           
=========================================
  Files           215      215           
  Lines          7718     7718           
  Branches        822      822           
=========================================
  Hits           5813     5813           
  Misses         1507     1507           
  Partials        398      398           

Continue to review full report at Codecov.

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

@marandaneto
Copy link
Contributor Author

I don't understand why moving the call to addActivity from onActivityCreated to onActivityStarted fixes the problem. Can you please elaborate on why this fixes the problem and add this info as a comment? The docs of FrameMetricsAggregator#add don't contain any information around this.

Ideally, we would have a UI test reproducing this issue, but I guess that is a bit complicated to achieve?

the comment states what I've found in their docs, https://firebase.google.com/docs/perf-mon/screen-traces?platform=android#definition
they don't have more information than that, but it does fix the issue.

yes, a UI test would be ideal but it's not easy since we don't have UI tests running, likely to be done when somebody is working on the test harness as well

@philipphofmann
Copy link
Member

@marandaneto, can you please add the link to the comment? Thanks.

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

…ityLifecycleIntegration.java

Co-authored-by: Philipp Hofmann <philipp.hofmann@sentry.io>
@romtsn
Copy link
Member

romtsn commented Oct 18, 2021

Just made a quick glance throw the source code - rough idea: if this is called in onActivityCreated, getDecorView overwrites all the previous feature flags set. (For instance, this is their comment from Activity.java)

I'd say that FrameMetricsAggregator doc is incomplete in this case and they should fix it :)

@marandaneto marandaneto merged commit d9cd9f8 into main Oct 18, 2021
@marandaneto marandaneto deleted the fix/activity-feature-notitle branch October 18, 2021 11:28
@github-actions
Copy link
Contributor

Fails
🚫 Please consider adding a changelog entry for the next release.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

- Window.FEATURE_NO_TITLE does not work when using activity traces ([#1769](https://github.com/getsentry/sentry-java/pull/1769))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description.

Generated by 🚫 dangerJS against ac49e6e

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.

Window.FEATURE_NO_TITLE does not work when activity traces or activity-lifecycle breadcrumbs enabled
4 participants