Skip to content
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

eng(supabase): prepare for first stable release #436

Merged
merged 4 commits into from
Sep 13, 2024
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
178 changes: 91 additions & 87 deletions packages/brick_offline_first/CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/brick_offline_first/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ homepage: https://github.com/GetDutchie/brick/tree/main/packages/brick_offline_f
issue_tracker: https://github.com/GetDutchie/brick/issues
repository: https://github.com/GetDutchie/brick

version: 3.2.0
version: 3.2.1

environment:
sdk: ">=2.18.0 <4.0.0"
Expand Down
2 changes: 2 additions & 0 deletions packages/brick_offline_first_with_graphql/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## Unreleased

- Apply minimum constraint on `brick_offline_first_build` to `3.2.0`

## 3.1.1

- Loosen constraints for `gql`, `gql_exec`, and `gql_link`
Expand Down
45 changes: 24 additions & 21 deletions packages/brick_offline_first_with_rest/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,52 @@
## Unreleased

* Expose offline queue functionality in `offline_queue.dart`
## 3.1.0

- Expose offline queue functionality in `offline_queue.dart`
- Include `request` in `RestOfflineQueueClient`'s generic error response

## 3.0.2

* Apply standardized lints
* Update minimum HTTP to 1.0.0
- Apply standardized lints
- Update minimum HTTP to 1.0.0

## 3.0.1

* Support Dart 3
- Support Dart 3

## 3.0.0

Please follow the [v3 migration guide](https://github.com/GetDutchie/brick/issues/325) to easily upgrade.

* Remove instance-access `reattemptForStatusCodes`; this is passed directly to the cache manager
* Remove extraneous constructor argument `throwTunnerNotFoundExceptions` and rely on remote policy / the queue manager
* Remove `brick_sqlite_abstract`
* Remove `brick_offline_first_abstract`
* Remove `brick_offline_first_with_rest_abstract`; add annotation `ConnectOfflineFirstWithRest` and class `OfflineFirstWithRestModel` to this package
* **BREAKING CHANGE** Rename main export file to `brick_offline_first_with_rest.dart`: `FieldRename`, `Graphql` `GraphqlProvider`, and `GraphqlSerializable` can all be imported from the `brick_rest` package
* Add `#subscribe` method to listen for SQLite updates
- Remove instance-access `reattemptForStatusCodes`; this is passed directly to the cache manager
- Remove extraneous constructor argument `throwTunnerNotFoundExceptions` and rely on remote policy / the queue manager
- Remove `brick_sqlite_abstract`
- Remove `brick_offline_first_abstract`
- Remove `brick_offline_first_with_rest_abstract`; add annotation `ConnectOfflineFirstWithRest` and class `OfflineFirstWithRestModel` to this package
- **BREAKING CHANGE** Rename main export file to `brick_offline_first_with_rest.dart`: `FieldRename`, `Graphql` `GraphqlProvider`, and `GraphqlSerializable` can all be imported from the `brick_rest` package
- Add `#subscribe` method to listen for SQLite updates

## 1.1.1

* Update default of offline queue from 0 seconds to 5 seconds
- Update default of offline queue from 0 seconds to 5 seconds

## 1.1.0

* Loosen dependency restrictions to major versions
* Import from `sqflite_common` instead of `sqflite` to avoid a Flutter dependency
* **BREAKING CHANGE** `OfflineFirstWithRestRepository#offlineQueueHttpClientRequestSqliteCacheManager` is now `OfflineFirstWithRestRepository#offlineQueueManager`
* **BREAKING_CHANGE** `offlineQueueManager` is required to create `BrickOfflineFirstWithRestRepository`. To migrate without recreating the queue database, pass RestRequestSqliteCacheManager('brick_offline_queue.sqlite', databaseFactory)
- Loosen dependency restrictions to major versions
- Import from `sqflite_common` instead of `sqflite` to avoid a Flutter dependency
- **BREAKING CHANGE** `OfflineFirstWithRestRepository#offlineQueueHttpClientRequestSqliteCacheManager` is now `OfflineFirstWithRestRepository#offlineQueueManager`
- **BREAKING_CHANGE** `offlineQueueManager` is required to create `BrickOfflineFirstWithRestRepository`. To migrate without recreating the queue database, pass RestRequestSqliteCacheManager('brick_offline_queue.sqlite', databaseFactory)

## 1.0.0

* Integrate new `OfflineFirstPolicy`s to the `RestOfflineQueueClient`
- Integrate new `OfflineFirstPolicy`s to the `RestOfflineQueueClient`

## 0.0.2

* Support new policies for skipping cache or requesting data. See [brick_offline_first's change notes](https://github.com/GetDutchie/brick/blob/main/packages/brick_offline_first/CHANGELOG.md) for how to migrate the breaking changes.
- Support new policies for skipping cache or requesting data. See [brick_offline_first's change notes](https://github.com/GetDutchie/brick/blob/main/packages/brick_offline_first/CHANGELOG.md) for how to migrate the breaking changes.

## 0.0.1

* **BREAKING CHANGE** `SqliteProvider` and `Query` are no longer exported `offline_first_with_rest.dart`. Please import from `package:brick_sqlite/db.dart` and `package:brick_core/query.dart` respectively.
* Create package from `brick_offline_first`
* Initial
- **BREAKING CHANGE** `SqliteProvider` and `Query` are no longer exported `offline_first_with_rest.dart`. Please import from `package:brick_sqlite/db.dart` and `package:brick_core/query.dart` respectively.
- Create package from `brick_offline_first`
- Initial
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class RestOfflineQueueClient extends http.BaseClient {
final genericErrorResponse = http.StreamedResponse(
Stream.fromFuture(Future.value('unknown internal error'.codeUnits)),
501,
request: request,
);

try {
Expand Down
2 changes: 1 addition & 1 deletion packages/brick_offline_first_with_rest/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ homepage: https://github.com/GetDutchie/brick/tree/main/packages/brick_offline_f
issue_tracker: https://github.com/GetDutchie/brick/issues
repository: https://github.com/GetDutchie/brick

version: 3.0.2
version: 3.1.0

environment:
sdk: ">=2.18.0 <4.0.0"
Expand Down
1 change: 1 addition & 0 deletions packages/brick_offline_first_with_rest_build/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## Unreleased

- (test) remove analysis options override for non-standard library prefixes
- Apply minimum constraint on `brick_offline_first_build` to `3.2.0`

## 3.2.0

Expand Down
4 changes: 4 additions & 0 deletions packages/brick_offline_first_with_supabase/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Unreleased

## 1.0.0

- Stable release

## 0.1.0

- Alpha release
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:brick_supabase/brick_supabase.dart';
import 'package:http/http.dart' as http;
import 'package:meta/meta.dart';
import 'package:sqflite_common/sqlite_api.dart' show DatabaseFactory;
import 'package:supabase/supabase.dart';

/// Ensures the [remoteProvider] is a [SupabaseProvider].
///
Expand Down Expand Up @@ -79,6 +80,25 @@ abstract class OfflineFirstWithSupabaseRepository
await offlineRequestQueue.client.requestManager.migrate();
}

@override
Future<TModel> upsert<TModel extends OfflineFirstWithSupabaseModel>(
TModel instance, {
OfflineFirstUpsertPolicy policy = OfflineFirstUpsertPolicy.optimisticLocal,
Query? query,
}) async {
try {
return await super.upsert<TModel>(instance, policy: policy, query: query);
} on PostgrestException catch (e) {
logger.warning('#upsert supabase failure: $e');

if (policy == OfflineFirstUpsertPolicy.requireRemote) {
throw OfflineFirstException(Exception(e));
}

return instance;
}
}

/// This is a convenience method to create the basic offline client and queue.
/// The client is used to add offline capabilities to [SupabaseProvider];
/// the queue is used to add offline to the repository.
Expand All @@ -96,7 +116,6 @@ abstract class OfflineFirstWithSupabaseRepository
409,
429,
500,
501,
502,
503,
504,
Expand Down
2 changes: 1 addition & 1 deletion packages/brick_offline_first_with_supabase/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ homepage: https://github.com/GetDutchie/brick/tree/main/packages/brick_offline_f
issue_tracker: https://github.com/GetDutchie/brick/issues
repository: https://github.com/GetDutchie/brick

version: 0.1.0+2
version: 1.0.0

environment:
sdk: ">=3.0.0 <4.0.0"
Expand Down
4 changes: 4 additions & 0 deletions packages/brick_offline_first_with_supabase_build/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Unreleased

## 1.0.0

- Stable release

## 0.1.0

- Alpha release
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ homepage: https://github.com/GetDutchie/brick/tree/main/packages/brick_offline_f
issue_tracker: https://github.com/GetDutchie/brick/issues
repository: https://github.com/GetDutchie/brick

version: 0.1.0+1
version: 1.0.0

environment:
sdk: ">=3.0.0 <4.0.0"
Expand Down
4 changes: 4 additions & 0 deletions packages/brick_supabase/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Unreleased

## 1.0.0

- Stable release

## 0.1.1

- Resolve `QuerySupabaseTransformer` bugs
Expand Down
2 changes: 1 addition & 1 deletion packages/brick_supabase/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ homepage: https://github.com/GetDutchie/brick/tree/main/packages/brick_supabase
issue_tracker: https://github.com/GetDutchie/brick/issues
repository: https://github.com/GetDutchie/brick

version: 0.1.1+6
version: 1.0.0

environment:
sdk: ">=3.0.0 <4.0.0"
Expand Down
4 changes: 4 additions & 0 deletions packages/brick_supabase_generators/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Unreleased

## 1.0.0

- Stable release

## 0.1.1

- Fix table name collision in offline adapter (#416)
Expand Down
2 changes: 1 addition & 1 deletion packages/brick_supabase_generators/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ homepage: https://github.com/GetDutchie/brick/tree/main/packages/brick_supabase_
issue_tracker: https://github.com/GetDutchie/brick/issues
repository: https://github.com/GetDutchie/brick

version: 0.1.1+7
version: 1.0.0

environment:
sdk: ">=3.0.0 <4.0.0"
Expand Down