fix(smart-forms): pushSmartForm Windows path-separator bug when creating a new page#71
Conversation
AI ReviewFixes a Windows-only path-separator bug in Checklist
Issues found[error] S5 — Two of the six required manifest files were not bumped to The PR updates four of the six version locations but leaves two at
Fix: bump both fields to [warning] U1 — Commit subject line is 82 characters (limit: 70) Suggested shorter form (69 chars): [advisory] U6 — No unit tests for the fixed code path The However, This review was generated automatically. A human maintainer should still make the merge decision. |
pushSmartForm Phase 2 mapped the create response back to local paths with filepath.Dir, which returns backslash-separated paths on Windows and misses the slash-keyed folder map. Creating a new page (pages/<id>/config) then aborted with "server did not return id for created file ...", even though the server had already created the folder and files (pullSmartForm showed them). The mapping now reuses resolveParentID (the same ToSlash-normalized lookup used when POSTing), so the key is consistent across OSes. No behaviour change on macOS/Linux (ToSlash is a no-op there). Bumps version 2.4.0 -> 2.4.1 across all six manifests + CHANGELOG. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
024e482 to
11ce860
Compare
AI ReviewRe-review after synchronize: fixes Windows path-separator bug in Checklist
Issues found[advisory] U6 — No unit tests for the fixed code path
Fixed since last review ✅
This review was generated automatically. A human maintainer should still make the merge decision. |
What
Fixes
pushSmartFormfailing on Windows when creating files inside a new subfolder — the common case being a new Smart Form page (pages/<id>/config+locale).Root cause
In
handlePushSmartFormPhase 2 (create-files), the tool mapped the server's create response back to local paths usingfilepath.Dir(relPath). On Windowsfilepath.Dirreturns backslash-separated paths (pages\survey), which miss the always-slash-keyedmanifest.Foldersmap. The lookup returned0, the response key never matched, and the push aborted with:Crucially, the POST that creates the objects used
resolveParentID(which normalizes withToSlash), so the folder and files were already created server-side — a subsequentpullSmartFormshowed the new page. That is the reported symptom: push errors, but pull shows the page.macOS/Linux were unaffected because
filepath.Diruses/there.Fix
The response mapping now reuses
resolveParentID— the exact sameToSlash-normalized lookup used when POSTing — so the key is consistent with the parent id actually sent, on every OS. The change is a no-op on macOS/Linux (ToSlashdoes nothing when paths already use/).Testing
go build ./...andgo vet ./...— clean.go test ./...— green.filepath.Dirlookup returns0whileresolveParentIDreturns the correct folder id; the assertions are OS-independent and pass on Linux/macOS too.pullSmartForm→ add a newpages/<id>/folder locally →pushSmartFormnow succeeds instead of erroring.Version
Patch bump
2.4.0 → 2.4.1across all manifests (.claude-plugin,.codex-plugin,.kiro-plugin,marketplace.json) +CHANGELOG.md, per repo house rules.🤖 Generated with Claude Code