Feat/on download ready sign fix#17
Closed
freeof123 wants to merge 4 commits into
Closed
Conversation
Expose onDownloadReady so UI can dismiss loading overlays after HEAD+tail validation; fix eth_hash_prefix to restore v4.x-compatible signatures. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Move download-ready signaling out of HttpSealedFileStream into a TransformStream (same pattern as createProgressTransformer) and pipe it in stream/blob download paths without modifying the HTTP stream class. Co-authored-by: Cursor <cursoragent@cursor.com>
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
HttpSealedFileStream新增onReady选项,并沿downloadUnsealed→streamDownloadAndDecrypt/blobDownloadAndDecrypt透传为onDownloadReady。在 HEAD + tail 校验完成、正文 Range 请求开始前触发,便于前端关闭准备蒙层。eth_hash_prefix的构造方式(\x19+Ethereum Signed Message:\n32),恢复与 v4.x 兼容的签名结果;补充回归测试与兼容向量校验。stream_download/blob_download通过createProgressTransformer统一进度回调(onProgress)。变更文件
src/browser/HttpSealedFileStream.jsonReady回调src/browser/downloadUnsealed.jsonDownloadReadysrc/browser/stream_download.jsonDownloadReadysrc/browser/blob_download.jsonDownloadReadysrc/common/progress.jscreateProgressTransformersrc/common/ypccrypto.common.jssignMessage以太坊前缀src/browser/README.mdonDownloadReadyAPI 文档test/HttpSealedFileStream.spec.mjsonReady触发时机test/BrowserCrypto.spec.mjsTest plan
HttpSealedFileStream测试:onReady在 HEAD+tail 后、正文 Range 前触发signMessage回归测试:前缀格式与 v4.x 兼容向量yarn test(Node 18,含gen:fixtures自动重生成 fixture)