Skip to content

Conversation

@abdotop
Copy link
Member

@abdotop abdotop commented Jan 13, 2026

fix(api-client): update version to 0.1.6 and refactor fetch function parameters

@abdotop abdotop linked an issue Jan 13, 2026 that may be closed by this pull request
@abdotop abdotop self-assigned this Jan 13, 2026
@abdotop abdotop marked this pull request as ready for review January 13, 2026 15:57
Copilot AI review requested due to automatic review settings January 13, 2026 15:57
@abdotop abdotop merged commit c3bd824 into master Jan 13, 2026
5 checks passed
@abdotop abdotop deleted the 15-fix-api-client-header-type branch January 13, 2026 15:58
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a type mismatch in the API client's signal fetch method. The implementation previously accepted headers: HeadersInit as the second parameter, but the type signature declared options?: Options | undefined. The fix updates the implementation to match the type signature, allowing the full Options object to be passed.

Changes:

  • Updated signal's fetch method parameter from headers: HeadersInit to opt (should be options?: Options)
  • Modified the fetcher call to extract headers from the options object
  • Bumped package version from 0.1.5 to 0.1.6

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
api-client/mod.ts Fixed signal fetch method to accept Options object instead of just HeadersInit, aligning implementation with type signature
api-client/deno.json Bumped version to 0.1.6

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

$.value = { pending: 0 }
},
fetch: async (input, headers: HeadersInit) => {
fetch: async (input, opt) => {
Copy link

Copilot AI Jan 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameter name opt is inconsistent with the rest of the codebase which uses options. Consider renaming opt to options to maintain consistency with the type signature at line 282 and the main fetcher function at line 187.

Copilot uses AI. Check for mistakes.
},
"name": "@01edu/api-client",
"version": "0.1.5",
"version": "0.1.6",
Copy link

Copilot AI Jan 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change modifies the signature of the signal's fetch method from (input, headers: HeadersInit) to (input, opt) where opt is of type Options | undefined. This is a breaking change for existing code that calls signal().fetch(input, headers) directly with a HeadersInit parameter. Such code would need to be updated to signal().fetch(input, { headers }). Consider bumping to version 0.2.0 instead of 0.1.6 to reflect this breaking change according to semantic versioning.

Suggested change
"version": "0.1.6",
"version": "0.2.0",

Copilot uses AI. Check for mistakes.
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.

Fix API client header type

2 participants