Skip to content

DCA card: a degraded rail 14 cap is shown without its reason #852

Description

@eaitbrahim

Found reviewing #850 (#850 (comment)).

payload._dca_summary (keel/web/payload.py:3665) sends the cap as money(cap, state=BAD) when the cap is not in force, but never sends plan.cap.degraded_reason. build_dca_plan puts the reason in a blocker only when worst_month_spend > allowance.

Reproduce: an unattested subscription with every asset rejected by the screen, which is an empty DB. The CLI prints rail 14 monthly buy cap on coinbase: $0.00 (because no subscription has been attested). The payload's only blocker is "no asset is eligible". The reason text is nowhere in the JSON, so the card shows a red $0.00 with no explanation.

Fix: carry the reason on the wire, for example in the cap field's display, and add a payload test for this case.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions