Skip to content

fix: crop bloated code and binary COMPASS-8902 #221

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

Merged
merged 3 commits into from
Feb 6, 2025
Merged

Conversation

paula-stacho
Copy link
Contributor

We already had a cap for strings. This PR adds cap for Binary and Code

Copy link
Member

@Anemy Anemy left a comment

Choose a reason for hiding this comment

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

lgtm! Left a question, not a blocker.

@@ -530,7 +549,7 @@ export class SchemaAnalyzer {
}

type.values.pushSome(
type.name === 'String' ? cropStringAt10kCharacters(value as string) : value
getCappedValue(type.bsonType, value)
Copy link
Member

Choose a reason for hiding this comment

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

A few lines up, there's the line

          type.values = bsonType === 'String'
            ? Reservoir(100) : Reservoir(10000);

Do we want to do that for binary and code as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah that makes sense, will add

@paula-stacho paula-stacho merged commit 8244e00 into main Feb 6, 2025
20 checks passed
@paula-stacho paula-stacho deleted the COMPASS-8902 branch February 6, 2025 11:57
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.

2 participants