Memory and snapshot sync route tests pass when the sender's schema version is dropped
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 88/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript, node.js
- Domain
- backend-api-design, testing
Research direction
Start with server/routes/memory.test.js and server/routes/dataSync.test.js, then compare their cases with the route calls in server/routes/memory.js and server/routes/dataSync.js. Add tests that pass schema version data through to the mocked services and assert how each route handles a 409 or blockedBySchema response. Done when the listed forwarding mutations fail the route tests and the HTTP boundary cases pass.
Written by the indexing model from the issue text.
Description
Slice audited: federation route tests (test-quality audit, 2026-10-18).
Problem
Two sync routes forward the sender's version envelope to the service gate that refuses or reshapes cross-version payloads (server/lib/schemaVersions.js). Their route tests never send that envelope, so forwarding is untested.
server/routes/memory.js:88-90and:101-103forwardschemaVersiontomemorySync.getChangesSince/applyRemoteChanges, which gate atserver/services/memorySync.js:39and:107.server/routes/memory.test.js:175,:184,:193assertgetChangesSince('10', 50)and:263assertsapplyRemoteChanges(memories); no case sends?schemaVersion=orbody.schemaVersion. Mutation probe: made both handlers always call the two-argument form.
Test Files 2 passed (2) Tests 49 passed (49)
server/routes/dataSync.js:186callsdataSync.applyRemote(category, data, { portosMeta }), the only thing that lets the version gate atserver/services/dataSync.js:1362fire for this route.server/routes/dataSync.test.js:388("leaves the write direction alone — apply is gated by its schema-version check, not this") posts noportosMetaand asserts{ portosMeta: undefined }, the one value that disables the gate it names. Mutation probe: replaced the forwarded value with the constant{ portosMeta: undefined }.
Test Files 1 passed (1) Tests 42 passed (42)
Impact
syncOrchestrator.js:322 pulls GET /api/memory/sync?…&schemaVersion=N from a peer; the serving install uses that to shape rows and to 409 a newer puller. With forwarding lost, rows go out in the legacy shape with no version in the envelope and the puller applies them as version 0. For the snapshot apply route, a newer-schema snapshot posted to an older install is applied ungated, the corruption schemaVersions.js exists to prevent. The service-level gates are covered only in memorySync.db.test.js, which pregate does not run, so the route layer is the only guard in the default CI plan.
Fix (decided)
server/routes/memory.test.js: addGET …?schemaVersion=NassertinggetChangesSincereceived('10', 50, N),POSTwithschemaVersionassertingapplyRemoteChanges(memories, N), and one case where the mocked service rejects with status 409 and the route passes the status through.server/routes/dataSync.test.js:388: replace the assertion. Post a populatedportosMeta: { portosVersion, schemaVersions: { digitalTwin: 99 } }, assert it is forwarded verbatim, and add one case where the mock returnsblockedBySchemaand the route surfaces it in the response.- No production code change.
Scope: small
Acceptance criteria
- Forcing the two-argument calls in
routes/memory.jsfailsroutes/memory.test.js. - Forwarding
{ portosMeta: undefined }unconditionally inroutes/dataSync.jsfailsroutes/dataSync.test.js. - A 409 or
blockedBySchemafrom the mocked service is asserted at the HTTP boundary in each file. - No production code change.
- Dominant language
- JavaScript
- Stars
- 38
- Forks
- 32
- Avg merge
- 40m
- Merged PRs (30d)
- 996
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from atomantic/PortOS
-
effort:low model:light plan planner:fable-5-1 test-quality tests
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
Series autopilot "skips when disabled" test passes through the crash catch-all, not the skip guardOpeneffort:low model:light plan planner:fable-5-1 test-quality tests
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Maintainers usually reply within 1 day
-
effort:low model:light plan planner:fable-5-1 test-quality tests
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
effort:low model:light plan planner:fable-5-1 test-quality tests
Difficulty 1/5 Under an hour Newbie friendliness 95/100
Maintainers usually reply within 1 day
-
Always-public API path check has no refusal test, so a prefix-match regression opens gated routesOpeneffort:low model:light plan planner:fable-5-1 test-quality tests
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day
All issues in atomantic/PortOS
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
maproulette/maproulette-frontend#2944 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
jaegertracing/jaeger-ui#4618 ·
Maintainers usually reply within 1 day
-
area:plugins enhancement platform:vscode
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
anthropics/claude-code#103166 ·
Maintainers usually reply within 1 day
-
Add: Kids Zone LogoOpencheck:failed logos:add
Difficulty 1/5 Under an hour Newbie friendliness 78/100
-
[workshop-sim] Improve: Add verifiable checkpoint and bridge to Step 5 (What Are Agentic Workflows?)Openfeedback simulation workshop
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
githubnext/gh-aw-workshop#4715 ·
Maintainers usually reply within 1 day