fix(import): bump fl_lib for the UTF-8 clipboard import fix - #1516
Merged
Merged
Conversation
`packages/fl_lib` moves to 5b77fae (lollipopkit/fl_lib#56), where the clipboard branch of `showImportDialog` encodes the pasted text with `utf8.encode` instead of `Uint8List.fromList(text.codeUnits)`. `codeUnits` is UTF-16 and the `Uint8List` constructor keeps only the low byte of each unit, so importing a snippet or server whose JSON held any non-ASCII text failed with `FormatException: Unexpected extension byte` at the strict `utf8.decode` in the backup page. ASCII survived by construction, which is why the branch looked correct until a name was Chinese. Closes #1513
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Essentials Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe Suggested reviewers: Priority: ➖ Normal Change: Bug fix · Severity of issue fixed: Medium 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
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.
What
Bumps
packages/fl_libfromb688e50to5b77fae(lollipopkit/fl_lib#56), which fixes clipboard import of any JSON containing non-ASCII text.Why
showImportDialog's clipboard branch built its bytes withUint8List.fromList(text.codeUnits).codeUnitsis UTF-16, and theUint8Listconstructor keeps only the low byte of each unit, so 启 (U+542F) became 0x2F and 动 (U+52A8) became 0xA8 — a continuation byte with no lead byte in front of it. Both callers decode strictly (utf8.decodein the backup page), so the import failed withFormatException: Unexpected extension byte.ASCII survived by construction, its low byte being the whole code unit, which is why this went unnoticed until a snippet or server name was Chinese. It affected snippet import and bulk server import alike; the file and network branches pass real bytes and never had the problem.
The fix is
utf8.encode(text)in the library. This PR only carries the submodule pointer; the code change and its reasoning live in lollipopkit/fl_lib#56.Closes #1513
Summary by CodeRabbit