-
Notifications
You must be signed in to change notification settings - Fork 731
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
[Rich text editor] Add error tracking for rich text editor #7695
[Rich text editor] Add error tracking for rich text editor #7695
Conversation
7ccadf3
to
9340eed
Compare
9340eed
to
08d5975
Compare
08d5975
to
275f4e2
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.
LGTM, thanks!
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.
Actually, I have a concern about user consent, I will comment.
analyticsConfig: AnalyticsConfig, | ||
private val analyticsStore: AnalyticsStore, | ||
private val lateInitUserPropertiesFactory: LateInitUserPropertiesFactory, | ||
@NamedGlobalScope private val globalScope: CoroutineScope | ||
) : VectorAnalytics { | ||
) : VectorAnalytics, ErrorTracker by sentryAnalytics { |
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.
Should we replace ErrorTracker by sentryAnalytics
by actual implementation in order to check for user consent in this class, before sending to sentry? This is maybe not necessary, if Sentry does nothing when it is not enabled, but better to double check.
override fun trackError(throwable: Throwable) {
sentryAnalytics
.takeIf { userConsent == true }
?.trackError(throwable)
}
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.
Good point, and I think it's nice to make this explicit.
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.
We don't need to check for userConsent because Sentry is not enabled if user has not consented. So any call to Sentry.captureException
will do nothing. But yeah, we can keep it explicit.
analyticsConfig: AnalyticsConfig, | ||
private val analyticsStore: AnalyticsStore, | ||
private val lateInitUserPropertiesFactory: LateInitUserPropertiesFactory, | ||
@NamedGlobalScope private val globalScope: CoroutineScope | ||
) : VectorAnalytics { | ||
) : VectorAnalytics, ErrorTracker { |
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.
Since VectorAnalytics
extends ErrorTracker
, there is no need to mention ErrorTracker
again here.
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.
vector/src/main/java/im/vector/app/features/analytics/impl/DefaultVectorAnalytics.kt
Outdated
Show resolved
Hide resolved
7323424
to
83ddf4a
Compare
…eat/PSU-953-rich-text-editor-error-tracking
…eat/PSU-953-rich-text-editor-error-tracking
SonarCloud Quality Gate failed. |
Type of change
Content
Add Sentry error tracking for internal rich text editor errors.
Motivation and context
https://element-io.atlassian.net/browse/PSU-953
Screenshots / GIFs
See example error tracked in Sentry.
Tests
Tested devices
Checklist
screenshots or videos if containing UI changeslink to the error log