Repository navigation
Send the proto's collection fields from the dev-proxy's node create and update - #3456
Conversation
Pragmatic Code Review — PR #3456 (initial review)Code Review SummaryVerdict: APPROVE. The fix is correct, small and proven by a real proxy + daemon test. Two non-blocking gaps are worth closing in this PR: the same bug exists on the create route, and the browser app still cannot change membership. What I checked against the code rather than the description:
Node-type sequence: not applicable. No type, field, relationship or structural rule changes; Requirements (issue #3455)
FindingsCritical IssuesNone. Suggested Improvements🟡 Important — the create route has the same bug
Recommendation: fix it here with the same validated loop over 🟡 Important — browser mode still cannot change membership, and the new fields have no production caller The description says the app changes membership "through the separate collection commands". That is true in Tauri only. In browser mode Recommendation, in order of preference:
Principle: correctness against the stated problem, and YAGNI — an endpoint capability nothing but a test calls. 🟢 Suggestion — pin why the "both" request is rejected The test asserts only 🟢 Suggestion — cover a collection change together with a field change Every case sends a collection-only PATCH, which takes the 🟢 Suggestion — stale usage examples now contradict the working contract These doc comments show Nitpicks
Security, performance, documentation
VerdictAPPROVE — a net improvement that is correct and tested. The two Important items are recommended for this PR but do not block it. |
malibio
left a comment
There was a problem hiding this comment.
Automated pragmatic-code-review: APPROVE (posted as a comment — GitHub blocks self-approval). Full findings in the review comment above.
Review feedback addressed (commit 08085b3)Addressed
Skipped
Tests
Re-Review DecisionDecision: RE-REVIEW NEEDED Rationale: this commit adds behaviour the first review did not see: a second proxy route changed, and two service methods went from no-ops to real requests. |
Pragmatic Code Review — PR #3456 (re-review)Review Type: Re-Review of commit Verdict: APPROVE. Both Important findings are fixed in the code, the fixes are tested against a real proxy and daemon, and the new commit introduces no Critical or Important problem. Previous Review Summary
Checked against the code, not the author's summary:
Was the skip reasonable? Yes. Both calls are in the static What I verified
Not verified: I did not drive the collection UI in a browser. The service methods are covered by a unit test with a mocked Node-type sequence: not applicable. No type, field, relationship or structural rule changes. Requirements (issue #3455)
FindingsCritical IssuesNone. ImportantNone. Suggested Improvements🟢 Suggestion — the PR title and description describe the first commit only The title says "node update" only. The body names the deleted 🟢 Suggestion — The error is built from Nitpicks
Security, performance, documentation
VerdictAPPROVE — every prior recommendation is resolved or reasonably skipped, and the new code is correct and tested. The two suggestions are optional; the PR description update is the one worth doing before merge. |
malibio
left a comment
There was a problem hiding this comment.
Automated pragmatic-code-review (re-review): APPROVE (posted as a comment — GitHub blocks self-approval). Full findings in the review comment above.
Re-review feedback addressedAddressed
Skipped
Re-Review DecisionDecision: NO RE-REVIEW NEEDED Rationale: the only code change since the re-review is one comment line. The rest is the PR title and description. |
…loses #3455) The PATCH node update forwarded `addToCollection` / `removeFromCollection`, which match no field on `UpdateNodeRequest`, so a collection change made during an update was dropped. It now forwards the repeated `addToCollections`, `addToCollectionIds` and `removeFromCollectionIds`, and refuses a value that is not an array of strings. The daemon keeps enforcing that paths and ids are mutually exclusive. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… changes - POST /api/nodes forwarded `collection`, which is not a field of CreateNodeRequest; it now forwards the repeated `collections` and `collectionIds`, validated the same way as the update fields. - HttpCollectionService adds and removes a membership by id through the node update, instead of doing nothing. - The e2e test covers create, a content change sent with a collection change, and the error code and message of each refusal. - node.ts usage examples point at collectionService; the updateNode examples they showed work on neither transport. Skipped: the two static `new HttpAdapter(...)` calls in the harness keep building the URL from the spawned port, since they run before an instance (and its `baseUrl`) exists. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
0537285 to
748f855
Compare
Closes #3455
What changed
The dev-proxy forwarded collection changes under field names the proto doesn't have, so they never reached the daemon.
PATCH /api/nodes/:id) sentaddToCollection/removeFromCollection. It now forwardsUpdateNodeRequest's repeatedaddToCollections(paths),addToCollectionIdsandremoveFromCollectionIds.POST /api/nodes) sentcollection. It now forwardsCreateNodeRequest's repeatedcollections(paths) andcollectionIds.HttpCollectionService.addNodeToCollectionandremoveNodeFromCollectiondid nothing; they now send the node update withaddToCollectionIds/removeFromCollectionIds.addNodeToCollectionPathis still a stub: it must return the leaf collection id, which the update response does not identify.The paths-or-ids rule is not duplicated in the proxy. The daemon already rejects a request carrying both, before it writes anything, and the proxy returns that as a 400.
Parity with the Tauri path
The issue asks to match what the Tauri path sends. The Tauri
update_nodecommand sends no collection fields:NodeUpdatehas none, and the command always passes empty lists. The Tauri app changes membership through separate collection commands. Browser mode now reaches the same daemon code for add and remove by id, through the node update rather than those commands.One difference: the update path looks the node up first, so a missing node returns
NOT_FOUND.Tests
node-collection-fields.e2e.ts, run against a real proxy and daemon (9 cases):INVALID_ARGUMENTand writes nothing; a non-array value returns 400collection-service.test.tsgains three cases for the two membership methods.baseUrlgetter, because the adapter has no method that sends these fields.The four cases from the first commit failed without the proxy change.
bun run test:changedpassed (frontend and browser tiers);bun run quality:fixmade no changes. The collection UI was not driven in a browser.Also: the usage examples in
node.tsshowedupdateNode(..., { add_to_collections }), which works on neither transport; they now point atcollectionService.🤖 Generated with Claude Code