Skip to content

fix(integration): 3 browser-found bugs — plans data source / seed idempotent / master-key docs (v0.3.4) - #82

Merged
argszero merged 1 commit into
mainfrom
feat/fix-integration-issues
Aug 18, 2026
Merged

argszero merged 1 commit into
mainfrom
feat/fix-integration-issues

Conversation

@argszero

Copy link
Copy Markdown
Owner

Summary

Fixes 3 bugs found during browser-driven end-to-end testing (rant 2026-08-18T16:14:21).

Changes

  • Bug 1 — share form Plan mismatch (UI listing always failed): backend now exposes GET /api/plans from config [[plans]] (single source of truth: id/provider/name/type/key_prefix/endpoints); frontend share form loads plans from the API when logged in (fallback = data.js D.PLANS realigned to config plan ids); plan type hint api→paygo.
  • Bug 2 — seed duplicate placeholder keys (keys table grew +1 every startup): seed() now inserts the placeholder upstream key only when the keys table is empty (was INSERT OR IGNORE with no unique constraint, polluting routing).
  • Bug 3 — missing master-key docs (dev random key made persisted ciphertext undecryptable after restart → all listings 503): config.example.toml [server] + README quick start now require ATP_MASTER_KEY / [server].master_key (openssl rand -hex 32) before first run.

Verification

  • cargo test: 72 passed / 0 failed (+2: seed_placeholder_key_is_idempotent, plans_endpoint_lists_config_plans)
  • cargo fmt --check / cargo clippy --all-targets -- -D warnings: clean; node --check on ui JS: clean
  • Live smoke (fresh temp DB): GET /api/plans → 12 plans incl. deepseek-paygo (name API(按量), prefix sk-, 3 endpoints); keys count 1 → 1 across server restarts

Related Issue

rant 2026-08-18T16:14:21(浏览器联调 3 个 bug)

Tests

  • cargo test 全部通过
  • cargo fmt --check 通过
  • 新增/更新了单元测试(+2)

Checklist

  • 分支命名符合约定(feat/ /fix/ /docs/ ...)
  • Commit message 使用 Conventional Commits 格式
  • 单一职责,改动最小化

…mpotent / master-key docs (v0.3.4)

Bug 1 (share form plan mismatch): backend GET /api/plans from config [[plans]]
single source (id/provider/name/type/key_prefix/endpoints); frontend share form
loads plans via API when logged in (data.js D.PLANS aligned to config ids as
fallback); plan type hint api→paygo.

Bug 2 (seed duplicate placeholder keys): seed() inserts the placeholder
upstream key only when keys table is empty (was INSERT OR IGNORE with no
unique constraint — every startup added one).

Bug 3 (master key docs): config.example.toml [server] + README quick start
stress ATP_MASTER_KEY / master_key must be set before first run (random dev
key makes persisted ciphertext undecryptable after restart).

Version 0.3.3 → 0.3.4. Tests 70 → 72 (seed idempotency + /api/plans endpoint).
Live smoke: /api/plans 12 plans incl deepseek-paygo; keys count stable across
restarts.
@argszero
argszero merged commit a2e40f2 into main Aug 18, 2026
1 check passed
@argszero
argszero deleted the feat/fix-integration-issues branch August 18, 2026 08:29
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