Repository navigation
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Reviewer's GuideImplementationValidate parsed translation dictionaries before caching so malformed values follow the failure path without replacing a usable dictionary.
DocumentationDocument the accepted translation-file format, the cache-preservation behavior, and the scope and verification of the fix.
TestsExercise invalid dictionary shapes and valid controls, checking failure callbacks and preservation of the existing usable dictionary.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Summary
The loader accepted JSON that is not a string-to-string translation dictionary. Non-string values can reach string rendering operations; JSON null replaced a working cached dictionary before Object.keys threw and reported failure.
Verification
83ceac969392e7ea1948652d0b2dd6d06233ddeb; separate from fix(translation): preserve latest language selection during async loads #7/fix(translation): only read own dictionary entries #8/fix(options): preserve existing confirmation handlers #9.Summary by Sourcery
Validate translation dictionaries before caching to prevent malformed data from breaking rendering or replacing usable translations.
Bug Fixes:
Documentation:
Tests:
Summary by cubic
Fixes translation loading so invalid JSON files no longer replace a working dictionary or feed non-string values into string rendering.
The loader now validates that a translation file is a non-null, non-array object whose values are all strings before caching it. Files that fail validation go through the existing failure callback and leave the previous usable dictionary intact. Empty dictionaries, empty string translations, and literal keys like
hasOwnPropertyremain valid.DynamicTranslation.jsand a regression test suite covering ten invalid shapes and two valid controls.docs/research/translation-file-schema.md.Written for commit c4bd843. Summary will update on new commits.
Hosted verification completed
PR CI 43904797840 passed all three jobs: Node 18 and Node 20 each ran 80 passing Jest tests; Python 3.11 ran 27 passing installer tests. No reruns or skipped tests.
Job logs confirm checkout
a9b8f3aa01cc07f9f24e700a4c1fa3c477549a46. Its verified parents are the stated base and headc4bd8430bc48c86ca4ebfd0bbb6bb7900d6fcf26; treef89c7f8a6ace161b6d222c1263a990f3ee85fc16equals the local tested/staged tree. All three remote modified files match the local content. This is verified PR merge-ref CI, not a separate bare-head push run.