Skip to content

Commit

Permalink
fix: Building web app fails because dbDirectory does not exist in `…
Browse files Browse the repository at this point in the history
…core_store_directory_web` (#948)
  • Loading branch information
mbfakourii authored Jul 10, 2023
1 parent ac682f2 commit d00f545
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
6 changes: 6 additions & 0 deletions packages/flutter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## [5.1.2](https://github.com/parse-community/Parse-SDK-Flutter/compare/flutter-5.1.1...flutter-5.1.2) (2023-07-11)

### Bug Fixes

* `dbDirectory` does not exist in `core_store_directory_web` in web ([#948](https://github.com/parse-community/Parse-SDK-Flutter/pull/948))

## [5.1.1](https://github.com/parse-community/Parse-SDK-Flutter/compare/flutter-5.1.0...flutter-5.1.1) (2023-06-28)

### Bug Fixes
Expand Down
1 change: 1 addition & 0 deletions packages/flutter/lib/parse_server_sdk_flutter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'dart:async';
import 'dart:io';
import 'dart:math';
import 'dart:ui';
import 'package:path/path.dart' as path;
import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
Expand Down
7 changes: 0 additions & 7 deletions packages/flutter/lib/src/storage/core_store_directory_io.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@ class CoreStoreDirectory {
return (await path_provider.getApplicationDocumentsDirectory()).path;
}

/// Returns the database directory.
Future<String> dbDirectory() async {
String dbDirectory = '';
dbDirectory = await CoreStoreDirectory().getDatabaseDirectory();
return path.join('$dbDirectory/parse', 'parse.db');
}

/// A migration algorithm for the internal SDK database file on iOS. This
/// function moves the database file from the documents directory to the
/// library directory to prevent issues with Parse SDK Flutter on iOS.
Expand Down
8 changes: 7 additions & 1 deletion packages/flutter/lib/src/storage/core_store_sembast.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,18 @@ class CoreStoreSembast implements sdk.CoreStoreSembastImp {
static Future<CoreStoreSembast> getInstance(
{DatabaseFactory? factory, String? password}) async {
_sembastImp ??= await sdk.CoreStoreSembastImp.getInstance(
await CoreStoreDirectory().dbDirectory(),
await _dbDirectory(),
factory: factory,
password: password);
return CoreStoreSembast._();
}

/// Returns the database directory.
static Future<String> _dbDirectory() async {
String dbDirectory = await CoreStoreDirectory().getDatabaseDirectory();
return path.join('$dbDirectory/parse', 'parse.db');
}

@override
Future<bool> clear() async {
await _sembastImp!.clear();
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: parse_server_sdk_flutter
description: The Flutter SDK to connect to Parse Server. Build your apps faster with Parse Platform, the complete application stack.
version: 5.1.1
version: 5.1.2
homepage: https://github.com/parse-community/Parse-SDK-Flutter

environment:
Expand Down

0 comments on commit d00f545

Please sign in to comment.