Skip to content

fix(cli): handle non-expiring credits and update quota guidance - #172

Open
mmurrs wants to merge 1 commit into
masterfrom
fix/credit-expiry-quota-message
Open

mmurrs wants to merge 1 commit into
masterfrom
fix/credit-expiry-quota-message

Conversation

@mmurrs

@mmurrs mmurrs commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

The credit-based billing flow can return nextCreditExpiry: "0" for credits that do not expire. The CLI treated that non-empty string as a valid timestamp and displayed December 1969 or January 1970. Separately, wallets with an uninitialized app quota were told to run ecloud billing subscribe, which is no longer the correct recovery action.

This change:

  • suppresses the expiry suffix for zero, string-zero, missing, negative, and invalid timestamps while preserving valid positive expirations;
  • replaces the subscription guidance with a credit-based message that identifies the environment and wallet, suggests a short retry for pending initialization, and gives the support contact for persistent failures;
  • adds command-level coverage for the string-zero sentinel and valid expiry timestamps.

Validation:

  • Focused billing status tests: 8 passed
  • SDK production build: passed
  • CLI production build: passed
  • ESLint on changed CLI and SDK files: passed
  • Prettier and git diff --check: passed

Broader repository checks have existing unrelated failures: the CLI-wide TypeScript check reports errors across existing tests and instance-type definitions, and running all billing tests together reports 40 passing tests plus one subscribe.test.ts mock-call assertion failure. The focused test file passes independently.

This branch has not been deployed

No deployments
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