Skip to content

DRIVERS-3479 Clarify logging truncation: Unicode code point safety and naive JSON are separate concerns#1937

Open
GromNaN wants to merge 1 commit into
mongodb:masterfrom
GromNaN:fix/logging-truncation-contradiction
Open

DRIVERS-3479 Clarify logging truncation: Unicode code point safety and naive JSON are separate concerns#1937
GromNaN wants to merge 1 commit into
mongodb:masterfrom
GromNaN:fix/logging-truncation-contradiction

Conversation

@GromNaN
Copy link
Copy Markdown
Member

@GromNaN GromNaN commented May 13, 2026

Jira: https://jira.mongodb.org/browse/DRIVERS-3479

The truncation section contained two MUST requirements in the same sentence that appeared contradictory:

  • "the driver MUST ensure that it gracefully handles cases where the truncation length falls mid code point"
  • "Drivers MUST implement truncation naively by simply truncating the output at the required length"

These actually apply to different things: the first concerns Unicode validity (don't produce invalid Unicode by splitting a code point), the second concerns JSON structure (don't try to produce valid JSON after truncation). Rewrite the paragraph to make the two scopes explicit.

No behaviour change intended.

The previous wording placed "MUST handle gracefully" (Unicode code points)
and "MUST implement naively" (JSON structure) in the same sentence, making
them read as contradictory requirements.

Rewrite to make clear they apply to different concerns:
- Do not split a Unicode code point at the truncation boundary.
- Do not attempt to produce valid JSON after truncation (naive truncation).
@GromNaN GromNaN requested a review from a team as a code owner May 13, 2026 13:38
@GromNaN GromNaN requested review from jyemin and removed request for a team May 13, 2026 13:38
@GromNaN GromNaN changed the title Clarify logging truncation: Unicode code point safety and naive JSON are separate concerns DRIVERS-3479 Clarify logging truncation: Unicode code point safety and naive JSON are separate concerns May 18, 2026
@GromNaN GromNaN enabled auto-merge (squash) May 20, 2026 14:30
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.

1 participant