Skip to content

fix(idc): gracefully handle FEATURE_NOT_SUPPORTED in usage limits#79

Open
leecoder wants to merge 1 commit intotickernelz:masterfrom
leecoder:master
Open

fix(idc): gracefully handle FEATURE_NOT_SUPPORTED in usage limits#79
leecoder wants to merge 1 commit intotickernelz:masterfrom
leecoder:master

Conversation

@leecoder
Copy link
Copy Markdown
Contributor

@leecoder leecoder commented Apr 9, 2026

Problem

Some IDC profiles do not support getUsageLimits, which returns a FEATURE_NOT_SUPPORTED error. This caused:

  1. Account registration to fail during IDC auth flow
  2. Usage tracker to penalize healthy accounts unnecessarily

Changes

src/core/auth/idc-auth-method.ts

  • Initialize usage with safe defaults so auth can proceed even if fetchUsageLimits fails
  • Catch FEATURE_NOT_SUPPORTED error and log a warning instead of throwing
  • Use makePlaceholderEmail as fallback when real email is unavailable

src/core/account/usage-tracker.ts

  • Early return on FEATURE_NOT_SUPPORTED to avoid penalizing the account

Testing

  • Build passes
  • No breaking changes to existing functionality

Some IDC profiles do not support getUsageLimits. This change prevents the account from being penalized or failing to register when the API returns FEATURE_NOT_SUPPORTED. A placeholder email is used when the real email cannot be fetched.
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