Skip to content
This repository has been archived by the owner on May 13, 2023. It is now read-only.

chore: add checks to test against Dart v2.15.0 #150

Merged
merged 6 commits into from
Oct 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ on:

jobs:
test:
name: Test / OS ${{ matrix.os }} / Node ${{ matrix.node }}
name: Test / SDK ${{ matrix.sdk }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
node: ['12']
sdk: [stable, beta, dev]
sdk: [2.15.0, stable, beta, dev]

runs-on: ${{ matrix.os }}

Expand Down
17 changes: 0 additions & 17 deletions lib/src/auth_session.dart

This file was deleted.

9 changes: 7 additions & 2 deletions lib/src/supabase_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class SupabaseClient {
late final RealtimeClient realtime;
late final PostgrestClient rest;
String? _changedAccessToken;
late StreamSubscription<AuthState> _authStateSubscription;

SupabaseClient(
this.supabaseUrl,
Expand Down Expand Up @@ -113,6 +114,10 @@ class SupabaseClient {
return realtime.removeAllChannels();
}

void dispose() {
_authStateSubscription.cancel();
}

Comment on lines +117 to +120
Copy link
Member Author

Choose a reason for hiding this comment

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

GoTrueClient _initSupabaseAuthClient({
bool? autoRefreshToken,
required Map<String, String> headers,
Expand Down Expand Up @@ -150,8 +155,8 @@ class SupabaseClient {
}

void _listenForAuthEvents() {
auth.onAuthStateChange((event, session) {
_handleTokenChanged(event, session?.accessToken);
_authStateSubscription = auth.onAuthStateChange.listen((data) {
_handleTokenChanged(data.event, data.session?.accessToken);
});
}

Expand Down
1 change: 0 additions & 1 deletion lib/supabase.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export 'package:postgrest/postgrest.dart';
export 'package:realtime_client/realtime_client.dart';
export 'package:storage_client/storage_client.dart';

export 'src/auth_session.dart';
export 'src/auth_user.dart';
export 'src/remove_subscription_result.dart';
export 'src/supabase_client.dart';
Expand Down
14 changes: 7 additions & 7 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ homepage: 'https://supabase.io'
repository: 'https://github.com/supabase/supabase-dart'

environment:
sdk: '>=2.14.0 <3.0.0'
sdk: '>=2.15.0 <3.0.0'

dependencies:
functions_client: 1.0.0-dev.4
gotrue: 1.0.0-dev.4
functions_client: ^1.0.0
gotrue: ^1.0.0
http: ^0.13.4
postgrest: 1.0.0-dev.4
realtime_client: 1.0.0-dev.5
storage_client: 1.0.0-dev.4
postgrest: ^1.0.0
realtime_client: ^1.0.0
storage_client: ^1.0.0

dev_dependencies:
lints: ^2.0.0
lints: ^1.0.1
test: ^1.17.9
web_socket_channel: ^2.2.0
11 changes: 0 additions & 11 deletions test/client_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@ void main() {
client = SupabaseClient(supabaseUrl, supabaseKey);
});

test('X-Client-Info header is set properly on auth', () {
final xClientHeaderBeforeSlash =
client.auth.api.headers['X-Client-Info']!.split('/').first;
expect(xClientHeaderBeforeSlash, 'supabase-dart');
});

test('X-Client-Info header is set properly on realtime', () {
final xClientHeaderBeforeSlash =
client.realtime.headers['X-Client-Info']!.split('/').first;
Expand Down Expand Up @@ -45,11 +39,6 @@ void main() {
);
});

test('X-Client-Info header is set properly on auth', () {
final xClientInfoHeader = client.auth.api.headers['X-Client-Info'];
expect(xClientInfoHeader, 'supabase-flutter/0.0.0');
});

test('X-Client-Info header is set properly on realtime', () {
final xClientInfoHeader = client.realtime.headers['X-Client-Info'];
expect(xClientInfoHeader, 'supabase-flutter/0.0.0');
Expand Down