Skip to content
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

Merged
merged 5 commits into from
Jun 15, 2022

Conversation

amortemousque
Copy link
Contributor

@amortemousque amortemousque commented Jun 14, 2022

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

  • Local
  • Staging
  • Unit
  • End to end

I have gone over the contributing documentation.

@amortemousque amortemousque requested a review from a team as a code owner June 14, 2022 09:53
@amortemousque amortemousque force-pushed the aymeric/fix-network-error-forwardErrorsToLogs branch from 88f464f to 5b86e50 Compare June 14, 2022 09:55
@codecov-commenter
Copy link

codecov-commenter commented Jun 14, 2022

Codecov Report

Merging #1591 (717ef52) into main (dc6cf2a) will increase coverage by 0.03%.
The diff coverage is 100.00%.

@@            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     
Impacted Files Coverage Δ
...sCollection/networkError/networkErrorCollection.ts 92.13% <100.00%> (+0.18%) ⬆️
...sCollection/runtimeError/runtimeErrorCollection.ts 100.00% <100.00%> (ø)
packages/core/src/tools/timeUtils.ts 100.00% <0.00%> (+2.85%) ⬆️

📣 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) => {
Copy link
Contributor Author

@amortemousque amortemousque Jun 15, 2022

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) {
Copy link
Contributor Author

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

@amortemousque amortemousque merged commit 1e57849 into main Jun 15, 2022
@amortemousque amortemousque deleted the aymeric/fix-network-error-forwardErrorsToLogs branch June 15, 2022 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants