Repository navigation
refactor: untangle runtime ownership and durable delivery - #292
Merged
Merged
Conversation
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.
Final song, rates and check-in replies bypass the persisted Telegram delivery path, while provider transport rules differ across features. This refactor gives those operations one owner and removes obsolete routes through the code.
Changes
Production Rust decreases from 194,162 to 191,997 lines (−2,165, excluding tests/comments). Tests increase by 1,270 lines and migration SQL by 6 lines. Thirty-one HTTP forwarding calls and the intermediate payment queue facade are removed. Most diff churn moves existing HTTP logic and the Discovery adapter to their owners.
docs/CODEBASE_MAP.mddocuments the resulting paths.Behavior and compatibility
The intended behavior changes are durable final rich delivery, consistent explicit protocol/provider configuration, and removal of fake pprof endpoints (authenticated 404). Existing commands, payloads, auth, payment semantics, streaming, budgets, fallback order, shutdown phases and persisted keys remain. Ambiguous Telegram sends keep a separate state; this does not promise exactly-once delivery.
Migrations 213/214 add nullable prepared-song payloads and a concurrent partial unique job index. Existing songs with NULL preparation and legacy rows remain readable. Down migration 214 removes the index concurrently; down 213 discards preparation data, so drain pending music delivery before rollback. Historical migrations are unchanged.
Verification
tools/rust-fast-gate.sh: formatting, Clippy across all targets/features with warnings denied, and workspace tests; 2,693 passed, 10 ignored. Repeated before publication.OPENPLOTVA_TEST_POSTGRES_DSN=<isolated-db> OPENPLOTVA_TEST_REDIS_URL=<isolated-redis> cargo test --locked -p openplotva-storage --lib -- --test-threads=1 --nocapture: 184 passed, 1 ignored benchmark, with actual Postgres 17/pgvector and Redis.tools/local-smoke.sh: health/readiness, settings routes/assets, login and signed admin state passed.Existing fixture setup/expectations were corrected where real-service verification exposed missing migrations, a missing fixed-date outbox partition and stale direct album-routing expectations. Those corrections do not change runtime album behavior. Production deployment is separate.