Skip to content

Conversation

grdsdev
Copy link
Contributor

@grdsdev grdsdev commented Sep 30, 2025

Summary

This PR ports the feature from supabase/functions-js#100 to add region as a forceFunctionRegion query parameter alongside the existing x-region header.

Changes

  • Updated FunctionsClient.buildRequest() to add the forceFunctionRegion query parameter when a region is specified
  • Modified tests to verify both the x-region header and forceFunctionRegion query parameter are sent
  • Maintains backward compatibility with existing x-region header functionality

Implementation Details

When a region is specified (either in the client or in invoke options), the Functions client now:

  1. Sets the x-region header (existing behavior)
  2. Adds a forceFunctionRegion query parameter with the same region value (new behavior)

This dual approach ensures better compatibility with edge function routing mechanisms.

Test Plan

  • ✅ All existing tests pass
  • ✅ Updated testInvokeWithRegion to verify query parameter is added
  • ✅ Updated testInvokeWithRegionDefinedInClient to verify query parameter is added
  • ✅ Verified no region results in no query parameter (existing test)

🤖 Generated with Claude Code

grdsdev and others added 2 commits September 30, 2025 17:02
- Updated FunctionsClient to add region as both x-region header and forceFunctionRegion query param
- Updated tests to verify both header and query parameter functionality
- Maintains backward compatibility with existing x-region header

Ported from supabase/functions-js#100

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@grdsdev grdsdev requested a review from a team September 30, 2025 20:13
@coveralls
Copy link

Pull Request Test Coverage Report for Build 18142247701

Details

  • 4 of 4 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.009%) to 77.815%

Totals Coverage Status
Change from base Build 18098073005: 0.009%
Covered Lines: 5591
Relevant Lines: 7185

💛 - Coveralls

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.

2 participants