-
Notifications
You must be signed in to change notification settings - Fork 7
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
New PushNotificationDataSource #688
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @nelsitoPuglisi and the rest of your teammates on Graphite |
2a9464e
to
eace200
Compare
be4eb50
to
5edc7f6
Compare
4117a92
to
504be70
Compare
5edc7f6
to
f4b7b57
Compare
504be70
to
db6a928
Compare
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.
I had one query about some assertions in the test cases, otherwise this looks good
import io.embrace.android.embracesdk.arch.schema.EmbType | ||
import io.embrace.android.embracesdk.findEventOfType | ||
import io.embrace.android.embracesdk.findSessionSpan | ||
import io.embrace.android.embracesdk.getSentSessionMessages | ||
import io.embrace.android.embracesdk.hasEventOfType | ||
import io.embrace.android.embracesdk.internal.ApkToolsConfig | ||
import io.embrace.android.embracesdk.internal.IdGeneratorTest.Companion.validPattern | ||
import io.embrace.android.embracesdk.internal.clock.millisToNanos | ||
import io.embrace.android.embracesdk.recordSession | ||
import org.junit.Assert |
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.
nit: I'd assume these are all unused imports?
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.
🤦
* List of captured push notifications | ||
*/ | ||
@Json(name = "pn") | ||
val pushNotifications: List<PushNotificationBreadcrumb>? = null, |
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.
Can the LegacyPushNotificationDataSource
be deleted if we're getting rid of payload fields in the same changeset?
@@ -69,6 +71,19 @@ internal class DataSourceModuleImpl( | |||
) | |||
} | |||
|
|||
override val pushNotificationDataSource: DataSourceState<PushNotificationDataSource> by dataSourceState { | |||
DataSourceState( |
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.
How do users enable this feature in their apps? I'm a little surprised that there isn't any parameter supplied for configGate
although if that's existing behavior that's ok
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.
This is used by manually calling our public api, and automacally if the feature is enabled with this guide: https://embrace.io/docs/android/features/push-notifications/
type | ||
) | ||
) { | ||
dataSourceModuleProvider()?.pushNotificationDataSource?.dataSource?.apply { |
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.
nit: you could remove the apply here as there's only one statement inside
"notification.title" to "", | ||
"notification.type" to type, | ||
"notification.body" to "", | ||
"notification.id" to "id", | ||
"notification.from" to "", |
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.
These empty string assertions don't look right - if "title"
and "body"
are being supplied as parameters in the test invocation then I'd expect them to show up in the attrs map.
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.
They shouldn't be sent because the default setting for PII capture is FALSE. A specific test captures that data when the setting is overridden to true.
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.
Got it. This is fine then
...sdk/src/main/java/io/embrace/android/embracesdk/capture/crumbs/PushNotificationDataSource.kt
Outdated
Show resolved
Hide resolved
f4b7b57
to
e384707
Compare
db6a928
to
251548a
Compare
aee3ba3
to
83a4109
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #688 +/- ##
==========================================
+ Coverage 79.83% 80.21% +0.38%
==========================================
Files 429 429
Lines 11330 11374 +44
Branches 1720 1725 +5
==========================================
+ Hits 9045 9124 +79
+ Misses 1558 1532 -26
+ Partials 727 718 -9
|
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
override val pushNotificationDataSource: DataSourceState<PushNotificationDataSource> by dataSourceState { | ||
DataSourceState( | ||
factory = { | ||
System.out.println("DataSourceModuleImpl ${essentialServiceModule.configService}") |
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.
Would suggest removing this println
statement
Goal
Log push notifications as span events in the session span instead of breadcrumbs
Testing
Integration and manual tests