Skip to content

feat: Add standard client headers #1130

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

grdsdev
Copy link
Contributor

@grdsdev grdsdev commented Mar 12, 2025

What kind of change does this PR introduce?

Bug fix, feature, docs update, ...

What is the current behavior?

Please link any relevant issues here.

What is the new behavior?

Feel free to include screenshots if it includes visual changes.

Additional context

Add any other context or screenshots.

Copy link

linear bot commented Mar 12, 2025

@coveralls
Copy link

coveralls commented Mar 12, 2025

Pull Request Test Coverage Report for Build 14792480636

Details

  • 8 of 8 (100.0%) changed or added relevant lines in 1 file are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.03%) to 75.4%

Files with Coverage Reduction New Missed Lines %
packages/supabase/lib/src/supabase_client.dart 2 67.74%
Totals Coverage Status
Change from base Build 14730510657: 0.03%
Covered Lines: 2878
Relevant Lines: 3817

💛 - Coveralls

@grdsdev grdsdev changed the title feat: add standard client headers feat: Add standard client headers Mar 12, 2025

class Constants {
static const Map<String, String> defaultHeaders = {
static String get platform {
return Platform.operatingSystem;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I know this is still draft, but still want to mention that this won't work on web.
You will either need a conditional import, or probably better use a constant to guard web with a definition like the kIsWeb in flutter:

const bool kIsWeb = bool.fromEnvironment('dart.library.js_util');

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, @Vinzent03

Do we have any test for asserting that it doesn't break in Web? Didn't see any fail on CI.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sadly not yet, but hopefully #1140 solves this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Vinzent03 I added the guard as you suggested, we could send data in case of web, if that is easy to do, not a requirement since our reports also fetches from the user-agent, and user-agent in web is better defined then mobile.

@grdsdev grdsdev force-pushed the guilherme/clibs-120-supabase-flutter-send-standard-client-headers-on-all branch from 3e7b4aa to 070966e Compare May 2, 2025 09:20
@grdsdev grdsdev marked this pull request as ready for review May 2, 2025 09:25
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.

3 participants