-
Notifications
You must be signed in to change notification settings - Fork 254
CLDSRV-830: Fix NaN serialization as null in access logs #6047
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
Conversation
Hello dvasilas,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
Incorrect fix versionThe
Considering where you are trying to merge, I ignored possible hotfix versions and I expected to find:
Please check the |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files
@@ Coverage Diff @@
## development/9.2 #6047 +/- ##
================================================
Coverage 84.35% 84.35%
================================================
Files 206 206
Lines 12997 12997
================================================
Hits 10964 10964
Misses 2033 2033
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
lib/utilities/serverAccessLogger.js
Outdated
| httpMethod: req.method ?? undefined, | ||
| bytesDeleted: params.analyticsBytesDeleted ?? undefined, | ||
| bytesReceived: req.parsedContentLength ?? undefined, | ||
| bytesReceived: Number.isNaN(req.parsedContentLength) ? undefined : (req.parsedContentLength ?? undefined), |
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.
| bytesReceived: Number.isNaN(req.parsedContentLength) ? undefined : (req.parsedContentLength ?? undefined), | |
| bytesReceived: Number.isInteger(req.parsedContentLength) ? req.parsedContentLength : undefined, |
could also flip the check
Server access logs contain explicit null values for bytesReceived
and contentLength when parsedContentLength is NaN. This happens
when Number.parseInt('', 10) returns NaN, which JSON.stringify
then serializes as null instead of omitting the field.
Add Number.isNaN() checks to convert NaN to undefined, allowing
JSON.stringify to omit these fields as intended.
c575008 to
23e383a
Compare
|
/approve |
Incorrect fix versionThe
Considering where you are trying to merge, I ignored possible hotfix versions and I expected to find:
Please check the The following options are set: approve |
|
🤖 |
ConflictA conflict has been raised during the creation of I have not created the integration branch. Here are the steps to resolve this conflict: git fetch
git checkout -B w/9.3/bugfix/CLDSRV-830 origin/development/9.3
git merge origin/bugfix/CLDSRV-830
# <intense conflict resolution>
git commit
git push -u origin w/9.3/bugfix/CLDSRV-830The following options are set: approve |
|
🤖 |
In the queueThe changeset has received all authorizations and has been added to the The changeset will be merged in:
The following branches will NOT be impacted:
There is no action required on your side. You will be notified here once IMPORTANT Please do not attempt to modify this pull request.
If you need this pull request to be removed from the queue, please contact a The following options are set: approve |
|
I have successfully merged the changeset of this pull request
The following branches have NOT changed:
Please check the status of the associated issue CLDSRV-830. Goodbye dvasilas. |
Server access logs contain explicit
nullvalues forbytesReceivedandcontentLengthwhenparsedContentLengthisNaN.Example seen in lab:
This happens when
Number.parseInt('', 10)returnsNaN, whichJSON.stringifythen serializes as null instead of omitting the field.