-
Notifications
You must be signed in to change notification settings - Fork 11
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
Improve AEI capture code quality #1694
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1694 +/- ##
==========================================
- Coverage 84.33% 84.32% -0.01%
==========================================
Files 458 459 +1
Lines 10683 10646 -37
Branches 1604 1597 -7
==========================================
- Hits 9009 8977 -32
+ Misses 945 941 -4
+ Partials 729 728 -1
|
6fc701c
to
9b81dfb
Compare
@@ -191,11 +191,11 @@ internal class EmbraceInternalInterfaceTest { | |||
assertAction = { | |||
val session = getSingleSessionEnvelope() | |||
val tapBreadcrumb = session.findSessionSpan().findEventOfType(EmbType.Ux.Tap) | |||
tapBreadcrumb.attributes?.assertMatches { | |||
"view.name" to "button" | |||
"tap.coords" to "10,99" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did this change? Because some test fixtures changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
View taps no longer capture coordinates by default: https://github.com/embrace-io/embrace-android-sdk/blob/main/UPGRADING.md#upgrading-from-6x-to-7x
#1691 meant the change in behavior wasn't caught in the test. This change will disappear from the PR after a rebase
|
||
// number of results to be returned; a value of 0 means to ignore this parameter and return | ||
// all matching records with a maximum of 16 entries | ||
private fun processAeiRecords() { | ||
val maxNum = appExitInfoBehavior.appExitInfoMaxNum() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that we will be dealing with all exists now rather than just those with blobs, is the limit we are setting still reasonable? Or will you tackle that when we actually implement that feature?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That will be tackled when we implement the feature. I haven't made any functional changes as part of this refactor.
7ab7b56
to
b830c76
Compare
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.OpenSSF Scorecard
Scanned Files |
} | ||
private fun getUnsentRecords(records: List<ApplicationExitInfo>): List<ApplicationExitInfo> { | ||
val deliveredIds = preferencesService.deliveredAeiIds | ||
preferencesService.deliveredAeiIds = records.map { it.getAeiId() }.toSet() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a mechanism to cap the growth of this list?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes - we rely on the android framework's in-built limit: https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/core/res/res/values/config.xml;l=5853?q=config_app_exit_info_history_list_size
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. One comment about capping the growth of deliveredAeiIds
but good to go for merging.
Goal
Improves the code quality of the AEI capture. I've attempted this by removing obsolete code constructs, renaming functions, moving to a more functional paradigm as opposed to mutating state, and by splitting up the data capture from the code that reads a trace file.
Testing
Relied on existing test coverage added in #1693