Skip to content

fix: add missing retry module for bags api integration#207

Open
0xAxiom wants to merge 3 commits intomainfrom
fix/add-missing-retry-module
Open

fix: add missing retry module for bags api integration#207
0xAxiom wants to merge 3 commits intomainfrom
fix/add-missing-retry-module

Conversation

@0xAxiom
Copy link
Owner

@0xAxiom 0xAxiom commented Mar 17, 2026

What: Created the missing retry.ts module that was causing import errors

  • Implements bagsApiFetch function with proper Bags API base URL handling and headers
  • Implements withRetry function with exponential backoff, jitter, and rate limiting awareness
  • Adds proper timeout support (30s default) and error handling
  • Includes rate limit header extraction utilities for monitoring API usage
  • Resolves import errors in file_upload.ts and fee_share_config.ts

Why:

  • The dapp-factory files were importing from ./retry.js but this module did not exist
  • This was causing runtime import failures when the Bags API integration was used
  • Identified during security review by Cipher subagent

Tested:

  • TypeScript compilation passes (npm run type-check:dapp)
  • No linting errors
  • Module properly exports required bagsApiFetch and withRetry functions
  • Follows established patterns from other utilities in the codebase

Technical details:

  • Uses proper ES module import/export syntax with .js extensions for compatibility
  • Implements exponential backoff with jitter to prevent thundering herd problems
  • Handles standard HTTP retry scenarios (429, 502, 503, 504, etc.)
  • Properly configured for Bags API rate limits (1000 req/hour)
  • Includes comprehensive error handling and logging

- Created missing retry.ts module that was causing import errors
- Implements bagsApiFetch function with proper Bags API integration
- Implements withRetry function with exponential backoff and rate limiting
- Adds timeout support and proper error handling
- Includes rate limit header extraction utilities
- Resolves import errors in file_upload.ts and fee_share_config.ts

This fixes the runtime import errors identified in security review.
@0xAxiom 0xAxiom requested a review from MeltedMindz as a code owner March 17, 2026 18:12
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