quickbird-uk / QuickbirdUWPDashboard

Quickbird UWP App and Server
http://www.quickbird.co.uk/
GNU General Public License v3.0
27 stars 7 forks source link

Crash on Sync #65

Closed VladimirAkopyan closed 6 years ago

VladimirAkopyan commented 6 years ago

When using Just local account, and the app downloaded from the store, the app crashed. No sure what the cause could be. Applies to version 1.6.13

VladimirAkopyan commented 6 years ago

I was wrong, 1.6.13 just crashes on sync, no idea why at this point.

VladimirAkopyan commented 6 years ago

It seems to happen only in release mode / .net native. WTF

VladimirAkopyan commented 6 years ago

This does not occur in debug mode - only happens in native compilation mode. The error is thrown by

private static async Task<string> GetRequestSensorHistoryAsync(MainDbContext db)

at line 424

 await Task.Run(() => db.SaveChanges()).ConfigureAwait(false);

SQLite foreign key violation exception

image I think this will be fixed if I deal with issue #8 and look at the sync method as a whole.

VladimirAkopyan commented 6 years ago

Checking .Net Native causes the crash. It is unaffected by optimisations or debug mode. How the fuck does .Net Native affect the foreign key constraint in SQL??

VladimirAkopyan commented 6 years ago

Actually looks like the bug is caused by a bug in EFCORE itself: https://github.com/aspnet/EntityFrameworkCore/issues/7614

VladimirAkopyan commented 6 years ago

I have updated all the packages in commit 0a86679127729641fcf0fc9cfaea35a243ee7de4 I have previously updated EFcore to 1.1.2. Now i've tried downgrading EFCORE back to 1.0.0. And Downgrading all EfCore Packages back to 1.0.0 DOES work

Previous version of .Net version was 5.2.2 Now it is 5.4. Let's see what happens - i will try newest version that actually works

VladimirAkopyan commented 6 years ago

1.1.0 works just Fine! 1.1.1 works just fine! Tested 1.1.2 and it does not work!

VladimirAkopyan commented 6 years ago

76 seems to be from the same saga