Obey relevant max_length when importing strings from the XPI#24713
Merged
diox merged 4 commits intomozilla:masterfrom Apr 8, 2026
Merged
Obey relevant max_length when importing strings from the XPI#24713diox merged 4 commits intomozilla:masterfrom
diox merged 4 commits intomozilla:masterfrom
Conversation
eviljeff
approved these changes
Apr 8, 2026
Member
There was a problem hiding this comment.
It's unfortunate there isn't a more optimal way of implementing this - we're doing essentially the same retrieval of max length and string slicing in 3 different places.
Member
Author
There was a problem hiding this comment.
Yeah, the whole thing really needs a deeper refactor. Next time...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes: mozilla/addons#15268
Linter validation isn't applied correctly for localized strings, and no validation is applied to the
descriptionfield (which becomes thesummaryin AMO). This silently truncates the strings when importing manifest data to avoid inconsistent data and errors that are difficult for developers to recover from themselves.Testing
descriptionof more than 250 characters in the manifestnamein the manifest of more than 50 charactersdescriptionin the manifest of more than 250 charactersdefault_localein the manifest pointing to a locale that has nomessages.json(or an incomplete one) in the xpidefault_localein the manifestFor all these cases, if the string goes over the max for the field, the value should be silently truncated. The linter may rise proper errors for these cases in the future (See mozilla/addons-linter#4910 for instance)