A failed upload from a file drop or paste leaves a stuck "Loading..." block
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- react, typescript
- 領域
- frontend, full-stack
調査の方向性
The report identifies handleFileInsertion, editor.uploadFile, and editor.updateBlock, but gives no file path or test name. Start by locating handleFileInsertion and tracing the drop and paste upload flow. Reproduce with uploadFile resolving to an empty string and with a rejected promise; done means a failed upload no longer leaves a Loading block and rejections are handled. An open linked pull request (#3247) already addresses this issue.
索引モデルが issue の本文から書いたものです。
説明
What’s broken?
When uploadFile fails for a file that was dropped or pasted into the editor, the inserted file block keeps showing "Loading..." forever. The user has to delete it by hand.
handleFileInsertion inserts a file block, awaits editor.uploadFile(file, blockId) and then always calls editor.updateBlock(blockId, { props: { url } }).
- If
uploadFileresolves with""to report a failure, the props don't change, so the block doesn't render again. Its vanilla render replaced the "Add file" button with.bn-file-loading-previewinonUploadStart, and nothing restores it when the upload ends. - If
uploadFilerejects, the rejection isn't caught.updateBlocknever runs, the promise rejection is unhandled, and the block stays on "Loading..." as well.
The file panel's upload tab doesn't show this, because it sets name together with url. The block renders again and offers "Add file".
What did you expect to happen?
A failed upload doesn't leave a stuck placeholder. The block is either removed or goes back to its "Add file" state, and a rejected uploadFile is caught. A documented way for uploadFile to report a failure would help too.
Steps to reproduce
- Create an editor whose
uploadFilefails:const editor = useCreateBlockNote({ uploadFile: () => Promise.resolve(""), }); - Drag any file from your computer into the editor, or paste one.
- A file block showing "Loading..." stays in the document.
With uploadFile: () => Promise.reject(new Error("rejected")) the block stays as well, and the console shows an unhandled promise rejection.
BlockNote version
@blocknote/core, @blocknote/react, @blocknote/mantine 0.55.0
Environment
No response
Additional context
We work around it by listening to onUploadEnd and, in a timeout after BlockNote's updateBlock, removing the block if it still renders .bn-file-loading-preview.
Contribution
- I'd be interested in contributing a fix for this issue
Sponsor
- I'm a sponsor and would appreciate if you could look into this sooner than later 💖
- 主要言語
- TypeScript
- スター
- 10.3k
- フォーク
- 780
- 平均マージ
- 3日 6時間
- マージ済み PR(30日)
- 48
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
TypeCellOS/BlockNote のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
TypeCellOS/BlockNote#2949 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
a11y
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
TypeCellOS/BlockNote#2855 ·
メンテナーはふだん 1 日以内に返信
-
a11y
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
TypeCellOS/BlockNote#2829 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Comment thread actions: hover-only controls and unlabeled buttons in ThreadsSideba対応中かも @matthewlipski が 1 日前に担当しました。 オープンa11y
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
TypeCellOS/BlockNote#2824 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 58/100
TypeCellOS/BlockNote#3245 ·
メンテナーはふだん 1 日以内に返信
TypeCellOS/BlockNote の issue をすべて見る
似ている issue
-
area: image-engine bug priority: low
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
snapotter-hq/SnapOtter#3885 ·
メンテナーはふだん 1 日以内に返信
-
Mend: dependency security vulnerability
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 3 日以内に返信
-
pending triage
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
bug P3 UI/UX
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
openclaw/openclaw#182077 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信