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

fix(NODE-5839): support for multibyte code-points in stringifyWithMaxLen #3979

Merged
merged 4 commits into from
Jan 26, 2024

Conversation

aditi-khare-mongoDB
Copy link
Contributor

@aditi-khare-mongoDB aditi-khare-mongoDB commented Jan 24, 2024

Description

Support truncation of multibyte codepoints through stringifyWithMaxLen into well-formed strings. (round down to the nearest codepoint).

What is changing?

  • Add codepoint check before truncation
  • If maxDocLength = 1, and maxDocLength--, return ' '
  • Un-skipped prose test #3 for command logging
  • No longer wrap lone strings in an extra quotation while stringifying for logger (makes stringification confusing to read and is unnecessary)
Is there new documentation needed for these changes?

No

What is the motivation for this change?

Prose test #3 command logging (see kickoff)

Double check the following

  • Ran npm run check:lint script
  • Self-review completed using the steps outlined here
  • PR title follows the correct format: type(NODE-xxxx)[!]: description
    • Example: feat(NODE-1234)!: rewriting everything in coffeescript
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

@aditi-khare-mongoDB aditi-khare-mongoDB changed the title ready for review fix(NODE-5839): Add support for multibyte code-points in stringifyWithMaxLen Jan 24, 2024
addaleax
addaleax previously approved these changes Jan 25, 2024
test/unit/mongo_logger.test.ts Outdated Show resolved Hide resolved
@nbbeeken nbbeeken added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Jan 25, 2024
@nbbeeken nbbeeken self-assigned this Jan 25, 2024
@nbbeeken nbbeeken self-requested a review January 25, 2024 18:03
@nbbeeken nbbeeken changed the title fix(NODE-5839): Add support for multibyte code-points in stringifyWithMaxLen fix(NODE-5839): support for multibyte code-points in stringifyWithMaxLen Jan 25, 2024
Copy link
Contributor

@nbbeeken nbbeeken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from slack: merge conflict, req changes for viz

@aditi-khare-mongoDB aditi-khare-mongoDB force-pushed the NODE-5839/truncate-multibyte-codepoints-gracefully branch from 2b29797 to 8cfc94c Compare January 25, 2024 19:38
@aditi-khare-mongoDB aditi-khare-mongoDB force-pushed the NODE-5839/truncate-multibyte-codepoints-gracefully branch from 68c0c00 to d39f0e4 Compare January 25, 2024 21:48
@nbbeeken nbbeeken merged commit aed1cf0 into main Jan 26, 2024
18 of 27 checks passed
@nbbeeken nbbeeken deleted the NODE-5839/truncate-multibyte-codepoints-gracefully branch January 26, 2024 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Primary Review In Review with primary reviewer, not yet ready for team's eyes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants