Skip to content

Migrate point_of_sale spec to deployConfig + transformRemoteToLocal#6909

Open
ryancbahan wants to merge 1 commit into02-27-rcb_contract-migration-1from
rcb/contract-point-of-sale
Open

Migrate point_of_sale spec to deployConfig + transformRemoteToLocal#6909
ryancbahan wants to merge 1 commit into02-27-rcb_contract-migration-1from
rcb/contract-point-of-sale

Conversation

@ryancbahan
Copy link
Contributor

@ryancbahan ryancbahan commented Feb 28, 2026

Summary

  • Remove transformConfig from point_of_sale spec, set deployConfig (pass-through with configWithoutFirstClassFields) and transformRemoteToLocal directly
  • transformLocalToRemote is now undefined — TOML shape sent directly to server
  • Part of the app module contracts migration

Test plan

  • Existing reverse transform test passes unchanged
  • New test verifies transformLocalToRemote is undefined

🤖 Generated with Claude Code

@github-actions
Copy link
Contributor

We detected some changes at packages/*/src and there are no updates in the .changeset.
If the changes are user-facing, run pnpm changeset add to track your changes and include them in the next release CHANGELOG.

Caution

DO NOT create changesets for features which you do not wish to be included in the public changelog of the next CLI release.

Remove transformConfig, set deployConfig (configWithoutFirstClassFields
pass-through) and transformRemoteToLocal directly. transformLocalToRemote
is now undefined — TOML shape is sent directly to the server.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ryancbahan ryancbahan force-pushed the rcb/contract-point-of-sale branch from 036d663 to e0af67f Compare February 28, 2026 02:47
@github-actions
Copy link
Contributor

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements 78.81% 14516/18419
🟡 Branches 73.16% 7221/9870
🟡 Functions 79.02% 3692/4672
🟡 Lines 79.15% 13723/17338

Test suite run success

3781 tests passing in 1449 suites.

Report generated by 🧪jest coverage report action from e0af67f

const {name, ...rest} = configWithoutFirstClassFields(config)
return rest
},
transformRemoteToLocal: (content: object) => ({pos: {embedded: (content as {embedded: boolean}).embedded}}),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remote/local config shape mismatch (likely breaking reverse transform)

deployConfig now returns the TOML shape (nested under pos), but transformRemoteToLocal still assumes the remote object is flat and reads content.embedded. If the server stores/returns what we now send ({pos:{embedded:true}}), then content.embedded will be undefined and local config becomes {pos:{embedded: undefined}}, which is incorrect and can break downstream validation/behavior.

Evidence in code:

// deploy sends nested:
return rest // likely { pos: { embedded: true } }

// reverse expects flat:
(content as {embedded: boolean}).embedded

Impact:

  • Merchants may see POS config flip/disappear after fetch/pull/sync.
  • CLI could produce invalid local TOML and re-deploy incorrectly (config drift).
  • Affects all users of the point_of_sale config extension once server returns nested shape.

const {name, ...rest} = configWithoutFirstClassFields(config)
return rest
},
transformRemoteToLocal: (content: object) => ({pos: {embedded: (content as {embedded: boolean}).embedded}}),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverse transform is unsafe on unexpected remote payload

transformRemoteToLocal force-reads (content as {embedded: boolean}).embedded without validating the payload. If the platform returns null, {}, {pos:{...}}, or embedded is not boolean, the result can become {pos:{embedded: undefined}} or lead to errors during parsing/validation.

Impact:

  • Pull/sync can generate invalid local TOML or break workflows like deploy, pull, config hydration.
  • Increases risk of clients re-uploading corrupted config.

@binks-code-reviewer
Copy link

🤖 Code Review · #projects-dev-ai for questions
React with 👍/👎 or reply — all feedback helps improve the agent.

Complete - 2 findings

📋 History

✅ 2 findings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant