-
Notifications
You must be signed in to change notification settings - Fork 146
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
Add the CallWebView
logs to our logging stack
#3637
Add the CallWebView
logs to our logging stack
#3637
Conversation
📱 Scan the QR code below to install the build (arm64 only) for this PR. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #3637 +/- ##
===========================================
- Coverage 82.77% 82.74% -0.03%
===========================================
Files 1747 1747
Lines 41391 41405 +14
Branches 5015 5016 +1
===========================================
Hits 34260 34260
- Misses 5358 5372 +14
Partials 1773 1773 ☔ View full report in Codecov by Sentry. |
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.
Thanks, but are we sure that the log from the WebView will not contain any sensitive data?
@@ -189,6 +191,11 @@ private fun WebView.setup( | |||
override fun onPermissionRequest(request: PermissionRequest) { | |||
onPermissionsRequested(request) | |||
} | |||
|
|||
override fun onConsoleMessage(consoleMessage: ConsoleMessage?): Boolean { | |||
consoleMessage?.let { Timber.d("[WebView]: ${it.message()}") } |
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.
Could maybe have a better mapping using other provided fields:
override fun onConsoleMessage(consoleMessage: ConsoleMessage): Boolean {
val priority = when (consoleMessage.messageLevel()) {
ConsoleMessage.MessageLevel.ERROR -> Log.ERROR
ConsoleMessage.MessageLevel.WARNING -> Log.WARN
else -> Log.DEBUG
}
Timber.tag("[WebView]").log(
priority = priority,
message = buildString {
append(consoleMessage.sourceId())
append(":")
append(consoleMessage.lineNumber())
append(" ")
append(consoleMessage.message())
},
)
return 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.
According to @toger5 they don't contain sensitive data, the only thing that could be considered 'sensitive' are user ids, but that should be fine to log. |
Quality Gate passedIssues Measures |
Content
Intercept the logs for the Element Call webview and log them using Timber so they go through our logging system.
Motivation and context
Element Call logs were lost in nightly and release versions of the app since they're not printed to the logcat or saved to disk, so it's very difficult to debug issues unless it's in a debug version.
Tests
[WebView]
prefixed logs inside.Tested devices
Checklist