[No QA] Fix the logging not to generate infinite logPack if Log request fails#75725
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
logPack if Log request failslogPack if Log request fails
|
reviewing... |
mountiny
left a comment
There was a problem hiding this comment.
Thanks @VickyStash for the investigation, the fix looks reasonable to me and safe, I dont see a reason for building the logPacket over time or why we need to log the error in case of Log request failing, but I think we can discuss that in slack later
@iwiznia curious if you could please check it out in case you see any problem with this solution
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariMacOS: DesktopBefore:
After:
|
situchan
left a comment
There was a problem hiding this comment.
Tests well.
if (request.command === 'Log') {
throw new Error('Test error');
}
After adding this snippet without fix, my browser got frozen after 5 min 😄
|
No product change, removing myself and unsubscribing |
|
✋ 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/mountiny in version: 9.2.63-0 🚀
|
|
🚀 Deployed to production by https://github.com/marcaaron in version: 9.2.63-8 🚀
|


Explanation of Change
In this PR we add the condition to prevent uncotrolled
logPackparam growing in case ofLogrequest failing.For a detailed explanation, please check
#74939 (comment)
#74939 (comment)
Fixed Issues
$ #74939
PROPOSAL: N/A
Tests
Pre-steps:
console.log('logParams:', logParams);Now you will need to compare how the
logParamslook with/without updates of this PR.Before:
logParamshas an endlessly growingrequest.data.logPacketstring. You will see how it grows every moment and can crash the app at some point.After:
logParamsdon't grow and don't haverequest.data.logPacketstring.Offline tests
N/A
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
N/A
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.