-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Change SendPerformanceTiming to be a read so it is not retried and ge… #21457
Conversation
…ts stuck in a loop
@aimane-chnaif Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
src/libs/actions/Timing.js
Outdated
@@ -51,11 +51,11 @@ function end(eventName, secondaryName = '') { | |||
return; | |||
} | |||
|
|||
API.write('SendPerformanceTiming', { | |||
API.read('SendPerformanceTiming', { |
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.
By making it a read it does not get retried nor saved in onyx nor anyhing like that, which for a stats command makes total sense.
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.
This won't call api again when back online from offline. You meant that?
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.
Yeah, this is tracking metrics on speed, it's not really important to save every piece of data. And by removing this it means it does not block other actually important requests (both in normal conditions and especially after coming back online since that's when the app becomes unresponsive or outdated)
So it's kind of the solution. I do need to investigate why this failure was not triggering our reauthentication mechanism, when it should've, but that's work for another PR.
src/libs/actions/Timing.js
Outdated
@@ -51,11 +51,11 @@ function end(eventName, secondaryName = '') { | |||
return; | |||
} | |||
|
|||
API.write('SendPerformanceTiming', { | |||
API.read('SendPerformanceTiming', { |
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.
This won't call api again when back online from offline. You meant that?
src/libs/actions/Timing.js
Outdated
name: grafanaEventName, | ||
value: eventTime, | ||
platform: `${getPlatform()}`, | ||
}); | ||
}, {}); |
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.
3rd param is Onyx data and it already defaults to {}
here 👇 so I think this change is redundant.
Line 93 in 67f627d
function makeRequestWithSideEffects(command, apiCommandParameters = {}, onyxData = {}, apiRequestType = CONST.API_REQUEST_TYPE.MAKE_REQUEST_WITH_SIDE_EFFECTS) { |
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.
But there's no default in the API.read method which is the one I am calling...
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.
That's fine. It's just redirected to makeRequestWithSideEffects
. Btw NAB
Lines 129 to 134 in 820fa93
function read(command, apiCommandParameters, onyxData) { | |
// Ensure all write requests on the sequential queue have finished responding before running read requests. | |
// Responses from read requests can overwrite the optimistic data inserted by | |
// write requests that use the same Onyx keys and haven't responded yet. | |
SequentialQueue.waitForIdle().then(() => makeRequestWithSideEffects(command, apiCommandParameters, onyxData, CONST.API_REQUEST_TYPE.READ)); | |
} |
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.
Please fill checklist
Done |
Reviewer Checklist
Screenshots/VideosWebweb.movMobile Web - ChromeMobile Web - SafariDesktopiOSAndroid |
Oh no engineer assigned as a reviewer.
|
It does not have the $ because it is not fixing the issue, that is correct |
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.
👍
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/amyevans in version: 1.3.33-0 🚀
|
🚀 Deployed to production by https://github.com/thienlnam in version: 1.3.33-4 🚀
|
…ts stuck in a loop
Details
Fixed Issues
#21444
Tests
throw new ExpError('asdsad', 'caca', '', [], false, 407);
to the backend code ofSendPerformanceTiming
App/src/libs/actions/Timing.js
Lines 49 to 52 in 2cd9b78
Offline tests
No
QA Steps
No
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Web
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android