-
-
Notifications
You must be signed in to change notification settings - Fork 33
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 Sqlite instrumentation #502
Conversation
added Sqlite new instrumentation
|
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.
Awesome job! There's 2 points I think that need attention - compatibility and a bytecode visitor test, but the rest is looking really good.
...build/src/main/kotlin/io/sentry/android/gradle/extensions/TracingInstrumentationExtension.kt
Outdated
Show resolved
Hide resolved
descriptor: String?, | ||
isInterface: Boolean | ||
) { | ||
if ( |
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 think there's one uncovered case with this approach, for example:
private val delegate: OpenHelper.Factory
private fun wrap(configuration: OpenHelper.Configuration): OpenHelper {
return delegate.create(configuration)
}
override fun create(configuration: OpenHelper.Configuration): OpenHelper = wrap(configuration)
in this case we'd still instrument it, because delegate.create(configuration)
is outside the create
method scope. But I think this is still fine and it's more of an edge case; we can always come back to it if someone reports an issue.
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.
Another weird thing - I tried to run it locally and decompile afterwards, and I see this weird bridge synthetic create
method in AutoClosingRoomOpenHelperFactory
:
However, I have no idea where it's coming from, the implementation doesn't look much different from the other open helpers they have. So I'm guessing it's still fine, because the other create
method is properly not instrumented. Maybe it's a bug in the decompiler tool not sure
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.
bottom line: nothing to address here, just we should be aware of both of these things :)
plugin-build/src/test/kotlin/io/sentry/android/gradle/SentryPluginAutoInstallTest.kt
Show resolved
Hide resolved
plugin-build/src/test/kotlin/io/sentry/android/gradle/instrumentation/VisitorTest.kt
Show resolved
Hide resolved
restored old db instrumentation for older SDK versions added Visitor test for FrameworkSQLiteOpenHelperFactory
restored old db instrumentation for older SDK versions added Visitor test for FrameworkSQLiteOpenHelperFactory
📜 Description
auto install of sentry-android-sqlite module
added Sqlite new instrumentation
💡 Motivation and Context
We want to refactor the database instrumentation moving as much as we can to the Java side, decreasing the need of bytecode manipulation.
The sdk side was convered in getsentry/sentry-java#2722
Here is the tracking issue: #401
💚 How did you test it?
📝 Checklist
🔮 Next steps