-
Notifications
You must be signed in to change notification settings - Fork 140
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
🐛 [RUMF-1303] stop forwarding network errors when forwardErrorsToLogs is false #1591
🐛 [RUMF-1303] stop forwarding network errors when forwardErrorsToLogs is false #1591
Conversation
88f464f
to
5b86e50
Compare
Codecov Report
@@ Coverage Diff @@
## main #1591 +/- ##
==========================================
+ Coverage 90.74% 90.77% +0.03%
==========================================
Files 121 121
Lines 4538 4543 +5
Branches 1018 1018
==========================================
+ Hits 4118 4124 +6
+ Misses 420 419 -1
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
source: ErrorSource.SOURCE, | ||
startClocks: { relative: 1234 as RelativeTime, timeStamp: 123456789 as TimeStamp }, | ||
type: 'Error', | ||
it('should send runtime errors', (done) => { |
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 updated the test to really trigger a runtime error instead of using the observable, because I found it more secure.
With the previous implem of runtimeErrorCollection
, when sending a message in rawErrorObservable the collection worked even if the forwardErrorsToLogs
was false.
if (configuration.forwardErrorsToLogs) { | ||
trackRuntimeError(rawErrorObservable) | ||
export function startRuntimeErrorCollection(configuration: LogsConfiguration, lifeCycle: LifeCycle) { | ||
if (!configuration.forwardErrorsToLogs) { |
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.
Avoid to unnecessary listen to the observable when forwardErrorsToLogs is false
Motivation
Since Logs v4.7.1, the Logs SDK forward network errors even when forwardErrorsToLogs is false. This issue as been introduced by Logs assembly refactoring PR #1463.
This PR fix it.
Changes
Check forwardErrorsToLogs in networkErrorCollection.ts
Testing
I have gone over the contributing documentation.