Skip to content

fix(cloud): restore learning_save_state RPC target (v1.9.1) - #184

Merged
WardLu merged 1 commit into
mainfrom
fix/cloud-save-rpc
Oct 18, 2026
Merged

WardLu merged 1 commit into
mainfrom
fix/cloud-save-rpc

Conversation

@WardLu

@WardLu WardLu commented Oct 18, 2026

Copy link
Copy Markdown
Owner

问题

自 v1.7.0(27ef161)起,客户端调用 learning_save_state_v3,但共享 Supabase 中从未迁移该函数。生产环境所有已登录家庭的云端保存都返回 404,跨设备同步失效。本机记录不受影响(local-first)。

修复

  • 保存 RPC 改回已上线的 learning_save_state(p_profile_id, p_state, p_expected_version);v3 压缩归档是普通 JSONB,现有函数直接接受,无需改 schema。
  • 去掉 p_write_protocol 参数。
  • 新增 tests/unit/cloud-rpc-contract.test.js:按 supabase/migrations 校验函数名和参数,防止 E2E mock 掩盖缺失的数据库函数。
  • 版本号升到 1.9.1。

Release-impact gate

  • production-impact:需要生产发布并在 sm.shadow.wang 验收云端保存返回 200。
  • 无数据库变更(不加 db-migration)。learning_save_state_v3 与 learning_record_activity_event 幂等哈希问题另行在 Shadow Portal 控制面提案。

验证

  • npm run check、npm run test:fast:69 个文件 / 647 个测试通过
  • node scripts/run-e2e.mjs --project=chromium tests/e2e/cloud.spec.js:63 个测试通过

…ersistence (v1.9.1)

Since v1.7.0 the client called learning_save_state_v3, which was never
migrated to shared Supabase, so every signed-in cloud save returned 404.
Point saves back at the deployed learning_save_state (the v3 compressed
archive is plain JSONB it already accepts) and drop p_write_protocol.

Add a contract test that checks the RPC name and parameters against
supabase/migrations so mocked E2E routes cannot hide a missing function.
@WardLu WardLu added the production-impact Changes production behavior or release operations label Oct 18, 2026
@WardLu
WardLu merged commit 7e110d1 into main Oct 18, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

production-impact Changes production behavior or release operations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant