Skip to content

fix(import): bump fl_lib for the UTF-8 clipboard import fix - #1516

Merged
GT-610 merged 1 commit into
mainfrom
fix/clipboard-import-utf8
Sep 19, 2026
Merged

GT-610 merged 1 commit into
mainfrom
fix/clipboard-import-utf8

Conversation

@GT-610

@GT-610 GT-610 commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator

What

Bumps packages/fl_lib from b688e50 to 5b77fae (lollipopkit/fl_lib#56), which fixes clipboard import of any JSON containing non-ASCII text.

Why

showImportDialog's clipboard branch built its bytes with Uint8List.fromList(text.codeUnits). codeUnits is UTF-16, and the Uint8List constructor 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.decode in the backup page), so the import failed with FormatException: 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

  • Chores
    • Updated the embedded library version to include the latest available changes.

`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
@coderabbitai

coderabbitai Bot commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Essentials

Run ID: 7791f9cc-a31b-4ade-be4a-a60be2b23749

📥 Commits

Reviewing files that changed from the base of the PR and between 69d7481 and 091e29f.

📒 Files selected for processing (1)
  • packages/fl_lib

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The packages/fl_lib submodule reference changes from commit b688e50518fa3314f99b639885c88c54411fcd4e to 5b77fae4221b4b6b86cf12b8a84438a6458eb853. No exported or public declarations change.

Suggested reviewers: lollipopkit

Priority: ➖ Normal

Change: Bug fix · Severity of issue fixed: Medium

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the fl_lib submodule bump and the included UTF-8 clipboard import fix. It matches the main change and is concise.
Linked Issues check ✅ Passed The change updates packages/fl_lib from b688e50 to 5b77fae. The PR summary identifies this target commit as containing the UTF-8 clipboard import fix from lollipopkit/fl_lib#56. This replaces …
Out of Scope Changes check ✅ Passed The whole-PR diff contains only the packages/fl_lib submodule pointer update. The stated change targets clipboard imports and leaves file and network imports unchanged. This matches the scope of #15
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

@coderabbitai
coderabbitai Bot requested a review from lollipopkit September 19, 2026 01:49
@GT-610
GT-610 merged commit 0f6e0ba into main Sep 19, 2026
15 checks passed
@GT-610
GT-610 deleted the fix/clipboard-import-utf8 branch September 19, 2026 02:09
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.

[Bug] 剪贴板导入代码片段:包含中文时报 FormatException: Unexpected extension byte

1 participant