4930: Return `UserError::InvalidDocumentId` for primary keys with a length greater than 512 bytes r=curquiza a=flevi29

# Pull Request

## Related issue
Fixes #4843

## PR checklist
Please check if your PR fulfills the following requirements:
- [x] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
- [x] Have you read the contributing guidelines?
- [x] Have you made sure that the title is accurate and descriptive of the changes?

Thank you so much for contributing to Meilisearch!


Co-authored-by: F. Levi <55688616+flevi29@users.noreply.github.com>
This commit is contained in:
meili-bors[bot] 2024-09-30 15:55:05 +00:00 committed by GitHub
commit e78da35287
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 50 additions and 32 deletions

View file

@ -543,7 +543,8 @@ impl fmt::Display for deserr_codes::InvalidSimilarId {
f,
"the value of `id` is invalid. \
A document identifier can be of type integer or string, \
only composed of alphanumeric characters (a-z A-Z 0-9), hyphens (-) and underscores (_)."
only composed of alphanumeric characters (a-z A-Z 0-9), hyphens (-) and underscores (_), \
and can not be more than 512 bytes."
)
}
}

View file

@ -88,7 +88,8 @@ impl fmt::Display for IndexUidFormatError {
f,
"`{}` is not a valid index uid. Index uid can be an \
integer or a string containing only alphanumeric \
characters, hyphens (-) and underscores (_).",
characters, hyphens (-) and underscores (_), \
and can not be more than 512 bytes.",
self.invalid_uid,
)
}