fix(host,client): review round 23 — create-path contract at every client declaration; close-edge resets; NFD tripwire; canonical double join

This commit is contained in:
creatixchu
2026-07-30 03:17:30 +08:00
parent de24461b91
commit df313b7531
10 files changed
+46 -21

No files matched your search

@@ -143,14 +143,14 @@ export class TestWorkspaces implements IWorkspaces {
* @param path - absolute existing parent directory.
* @param name - single path segment.
* @returns the created directory's absolute path, in the shape
* `DirectoryPickerBrowseCapability.createDirectory` contracts (verbatim
* equal to the child's `entries[].path` in the parent's next listing).
* `IWorkspaces.createDirectory` contracts.
*/
async createDirectory(path: string, name: string): Promise<string> {
this.calls.push({ method: 'createDirectory', args: [path, name] })
const stub = this.stubs.get('createDirectory')
if (stub !== undefined) return await (stub(path, name) as Promise<string>)
return `${path}/${name}`
// Canonical join: a bare-root parent must not double the separator.
return path.endsWith('/') ? `${path}${name}` : `${path}/${name}`
}
/**