Repository navigation
fix(integration): 3 browser-found bugs — plans data source / seed idempotent / master-key docs (v0.3.4) - #82
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes 3 bugs found during browser-driven end-to-end testing (rant 2026-08-18T16:14:21).
Changes
GET /api/plansfrom 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.jsD.PLANS realigned to config plan ids); plan type hintapi→paygo.seed()now inserts the placeholder upstream key only when the keys table is empty (wasINSERT OR IGNOREwith no unique constraint, polluting routing).[server]+ README quick start now requireATP_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 --checkon ui JS: cleanGET /api/plans→ 12 plans incl.deepseek-paygo(name API(按量), prefix sk-, 3 endpoints); keys count 1 → 1 across server restartsRelated Issue
rant 2026-08-18T16:14:21(浏览器联调 3 个 bug)
Tests
cargo test全部通过cargo fmt --check通过Checklist