Skip to content

fix(alerts): treat empty stored right-hand fields as missing - #3

Merged
mr-karan merged 1 commit into
mainfrom
fix/alerts-empty-stored-rhs-attribute
Nov 12, 2026
Merged

mr-karan merged 1 commit into
mainfrom
fix/alerts-empty-stored-rhs-attribute

Conversation

@mr-karan

Copy link
Copy Markdown
Member

Summary

Follow-up to #1. Kite returns empty strings rather than nulls for unset right-hand fields, and the crate reads them as Some(""). alerts modify passed those through when reusing the stored alert:

  • --rhs on a stored instrument alert with an empty rhs_attribute sent "" instead of defaulting to LastTradedPrice.
  • Editing a stored instrument alert without --rhs sent an empty exchange, symbol or attribute instead of failing with the existing "stored alert has no right-hand ..." error.

A small stored() helper now treats an empty stored value as missing at all four reads.

Evidence

alerts_modify_treats_an_empty_stored_rhs_attribute_as_missing in tests/cli_output.rs uses an instrument alert with rhs_attribute: "". It fails before the change (exit 0 with the empty value sent) and passes after. cargo fmt --check, cargo clippy -D warnings and the alert tests pass locally.

Kite returns empty strings rather than nulls for unset right-hand
fields, and the crate reads them as Some(""). alerts modify passed
those through, so a stored instrument condition with an empty
exchange, symbol or attribute sent the empty value instead of using
the default or failing with the existing error.

Follow-up to #1.
@mr-karan
mr-karan merged commit 2dbd9a5 into main Nov 12, 2026
3 checks passed
@mr-karan
mr-karan deleted the fix/alerts-empty-stored-rhs-attribute branch November 12, 2026 04:17
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