Skip to content

Deduplicate ResponseInterceptor type definition #534

Closed

Description

@DeFiVC

What

The ResponseInterceptor type is defined in two places with different signatures:

  • src/types/api.ts (lines 29-32): Uses generic T
  • src/lib/api/client.ts (lines 148-164): Uses ApiResponse<T>

This creates type confusion — consumers may import the wrong one, and the two definitions can drift apart.

Why

Type duplication with divergent signatures is a maintenance hazard. It can cause subtle type errors when the API client and consuming code disagree on the interceptor shape.

Scope

  • Choose one canonical definition (likely types/api.ts since it's the shared types file)
  • Update client.ts to import from types/api.ts
  • Ensure the chosen definition works for all usages
  • Update any other files that import the non-canonical version

Acceptance Criteria

  • ResponseInterceptor is defined in exactly one place
  • All imports reference the canonical definition
  • npm run typecheck passes
  • No behavioral changes to the API client

Technical Context

  • Files: src/types/api.ts, src/lib/api/client.ts
  • Used by: API client response interceptor chain

Activity

  1. added
    bugSomething isn't working
    mediumFunctionality impaired but workaround exists, edge case, partial feature
    on Oct 14, 2026
  2. mazikush365 commented on Oct 21, 2026

    @mazikush365

    @mazikush365 has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    I’d like to take ownership of this refactor. I’ll consolidate ResponseInterceptor into a single canonical type, align its signature with the API client’s actual response handling, and update all imports and consumers to use the shared definition. I’ll also run TypeScript checks and relevant tests to ensure the change removes duplication without introducing regressions.

    Please assign this issue to me so I can implement and verify the fix.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @mazikush365 to this issue.

  3. tecch-wiz commented on Oct 21, 2026

    @tecch-wiz
    Contributor

    @tecch-wiz has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    Hi! I’d like to take this issue. I’ll go through the existing implementation, identify the root cause, and work on a clean solution before submitting a PR for review.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @tecch-wiz to this issue.

  4. drips-wave commented on Oct 21, 2026

    @drips-wave

    Congratulations, @tecch-wiz! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on October 22, 2026.

    🧑‍💻 @tecch-wiz: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

    Warning

    When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

    🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

    🌊 Happy Wave 🌊

  5. grantfox-oss commented on Oct 23, 2026

    @grantfox-oss

    🎉 This issue has been marked as completed on GrantFox!

    @tecch-wiz's PR #665 was approved and merged by @DeFiVC.

    🏆 @tecch-wiz: You earned 40 FoxPoints for this contribution! Your current tier: Builder (1,065 total points). Track your full progress on GrantFox.

    👏 Great work, @tecch-wiz! Keep contributing to ChainLearnOfficial.

  6. drips-wave commented on Oct 23, 2026

    @drips-wave

    This issue has been completed by @tecch-wiz as part of the Stellar Wave Program's 10th Wave 🥳

    😎 @tecch-wiz: You earned 200 Points for completing this issue! Once the Wave's rewards are finalized, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.

    🧑‍💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.

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

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programbugSomething isn't workingmediumFunctionality impaired but workaround exists, edge case, partial featuretypescriptTypeScript language

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions