Repository navigation
Replies: 1 comment
|
The lookup really does depend on the browser's URL parser.
Two facts that matter for your report:
Portable fix, and it removes the browser from the equation: check the scheme prefix yourself, then take the authority as The other two failures in your report (PDF worker features, session-log download) I can't judge — they depend on that build's feature set, and I would only be guessing. If you file them, keep them as separate items with their own reproductions; bundled with the protocol one they will be read as one issue. Read-only source inspection at master |
Uh oh!
There was an error while loading. Please reload this page.
Environment
0.2.1-rc.2,dsh webprofile, Linux arm64 (Kylin V10 SP1)128.0.6613.119 Built on Kylin(this build reports a x86_64 UA on an aarch64 host, i.e. it is a custom/older branch)I patched all three locally against the built artifacts (
node_modules/**/lib/client*.js) to keep working, but the proper fixes belong in source. Diffs below are conceptual — I can send PRs if the project wants them.1.
dsh-client-resources:protocolOf()returnsundefinedfor validdsh-resource://addressespackages/client/resourcesderives the protocol key withnew URL(address).hostname. For non-special schemes the WHATWG URL parser is not required to populatehostname, and this Chromium build returns""fordsh-resource://file/x. The address is then classified as "not a resource", every record stays in statusnone, and the right sidebar shows "文件资源服务不可用" — with no console error, a clean host log, and no recovery on refresh. Meanwhile everyworkspaceFiles.*RPC works fine, which makes it very hard to localize.Proposed fix — parse the authority from the string and keep
URLonly as a fallback:This is behaviour-identical to the current code on conforming parsers (I checked
DSH-RESOURCE://File/x,dsh-resource:///x,dsh-resource://user@file/x,/home/a.md, and bare paths).2.
dsh-client-ui-sidebar-documentpreview: PDF worker throwsn.toHex is not a functionOpening any
.doc/.docxyields "无法显示 PDF:n.toHex is not a function". The conversion succeeds — the PDF bytes arrive — the failure is inside pdf.js 6.3.289.pdf.js depends on several recent JS built-ins:
Uint8Array.prototype.toHex/toBase64,Uint8Array.fromHex/fromBase64,Math.sumPrecise,Map.prototype.getOrInsert(Computed),RegExp.escape,Error.isError, andPromise.try. Upstream pdf.js installs these itself insrc/shared/util.js, but the bundler treats those statements as side-effect-free and drops them, so the shipped chunk contains the call sites only.Two details that matter for a fix:
PDFDocument.fingerprintsdoescalculateMD5(...).toHex(), and the worker source is an inline 1.27 MB string in the chunk that is turned into a blob at runtime:Workeris fragile. What works is prefixing the polyfill into that string (var _dsh_pdf_worker_default = "<polyfill>(self);" + "<original>").Promise.tryis used unguarded by the worker message pump, so it must be in the set even though it happens to exist in Chrome 128.Suggestion: ship the polyfills as a tiny module that is concatenated in front of the worker string and also evaluated at chunk top-level, rather than relying on pdf.js's own side effects surviving tree-shaking.
3.
dsh-session-log-export: "Download session log" silently downloads nothingsession-log-export/lib/client.js─downloadUrl():The host side is fine (
HEAD /api/session.export?...→200+content-disposition: attachment; filename="dsh-session-<id>.zip", and a manualGETreturns the ZIP). But the<a>is detached, and several Chromium forks ignoreclick()on a detached anchor. Result: no download, no error, no browser download-history entry — the FE reports success because it only checked theHEAD.This one is a one-liner and is correct in every browser, not just this one.
All reactions