feat(prices): balance.service prices section + rate-limit + tests (#156) #166
No reviewers
Labels
No labels
autopilot:pending-human
source:analyste
source:defenseur
source:human
source:medic
status:approved
status:blocked
status:in-progress
status:needs-clarification
status:needs-fix
status:ready
status:review
status:triage
type:bug
type:feature
type:infra
type:refactor
type:schema
type:security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: maximus/Simpl-Resultat#166
Loading…
Reference in a new issue
No description provided.
Delete branch "issue-156-balance-service-prices"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
pricesnamespace export onbalance.service.tsbalance.priceFetching.errors.*keys)vi.useFakeTimers()— happy, auth/premium/404 no-retry, 429 no-retry, 5xx retries, dedup, pacing, session capTest plan
npx tsc --noEmitcleannpx vitest run src/services/balance.service.test.ts— 94/94 green (existing 85 + 9 new)vi.fn()on invokeDepends on Rust side from #155 PR (string-based invoke; this PR works in isolation against mocked invoke).
Closes #156
Generated autonomously by /autopilot run of 2026-04-27
- prices.fetchPrice wraps invoke('fetch_price', ...) with local rate-limit (1/2s), in-flight dedup, exp backoff on 5xx (2/4/8s, max 3 retries), no retry on 4xx/429, hard 100/session cap - 9 vitest tests with vi.useFakeTimers() (happy, 401/403/404, 429 no-retry, 5xx retries, dedup, pacing, session cap) - Annexe B i18n mapping wired (PriceError → balance.priceFetching.errors.* keys) - Session cap checked before rate-limit/dedup; failures do not consume budget (MEDIUM decision) Closes #156 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>