-
-
Notifications
You must be signed in to change notification settings - Fork 75
Closed
Labels
bugThis issue reports broken functionality or another errorThis issue reports broken functionality or another error
Description
What is the bug?
The create method says "Does nothing if the store already exists." but it doesn't.
Putting await FMTCStore('mapStore').manage.create(); in the main method which means executed each time the app stared will trigger UniqueViolationException, the first time everything will work find because the store name hasn't been created yet, but when you refresh the app the following exception occurs.
UniqueViolationException (ObjectBoxException: object put failed: Unique constraint for ObjectBoxStore.name would be violated by putting object with ID 2 because same property value already exists in object with ID 1)
How can we reproduce it?
void main() async {
WidgetsFlutterBinding.ensureInitialized();
Object? initErr;
try {
await FMTCObjectBoxBackend().initialise();
await FMTCStore('mapStore').manage.create();
} catch (err) {
initErr = err;
print("Error initialising FMTC: $err");
}
// .......
}
Do you have a potential solution?
No
Platforms
macOS 15.1
Severity
Fatal: Causes the application to crash
Metadata
Metadata
Assignees
Labels
bugThis issue reports broken functionality or another errorThis issue reports broken functionality or another error