sobri909 / ArcMini

GNU Lesser General Public License v3.0
97 stars 18 forks source link

Fatal error: ... no such table: TimelineRangeSummary #119

Open BrianBatchelder opened 3 years ago

BrianBatchelder commented 3 years ago

After selecting System Debug Info from the "..." drop down menu, I get a fatal error:

Arc_Mini/ArcStore.swift:273: Fatal error: 'try!' expression unexpectedly raised an error: SQLite error 1 with statement `SELECT COUNT(*) FROM TimelineRangeSummary WHERE backupLastSaved IS NULL OR backupLastSaved < lastSaved`: no such table: TimelineRangeSummary
2021-06-12 14:11:08.027538-0700 Arc Mini[10768:160328] Arc_Mini/ArcStore.swift:273: Fatal error: 'try!' expression unexpectedly raised an error: SQLite error 1 with statement `SELECT COUNT(*) FROM TimelineRangeSummary WHERE backupLastSaved IS NULL OR backupLastSaved < lastSaved`: no such table: TimelineRangeSummary

Looking at the SQL, the "TimelineRangeSummary" table does not exist. I'm not familiar with GRDB, and I can't find the code where it is supposed to be created. Maybe it is missing from ArcStore's DB migrator? Or perhaps the catch should create the table if it is missing?

BrianBatchelder commented 3 years ago

Another observation: I see "group.ArcApp" in the code, and that string was also used for the Xcode "App Groups". But I couldn't build for my own team, as it wouldn't allow me to use that App Group, failing with the message: "An Application Group with Identifier 'group.ArcApp' is not available. Please enter a different string." Perhaps there is some interplay there, and I need to change the instances of "group.ArcApp" in the code to the same app group I set in Xcode?

On a lark, I tried the change. Same failure.

sobri909 commented 3 years ago

Hmm. Looks like I've committed some stuff that depends on db migrations in Arc v3 that Mini doesn't have. As a quick fix, you can comment out line 43 in SystemDebugView.swift. But I'll commit a proper fix shortly.

I guess this hasn't shown up before because for me Mini and v3 share the same database, due to being in the same App Group. But if you're building from source that won't be possible, due to App Group security.

Which brings me to your second reply. Yeah, the group.ArcApp is the App Group identifier that allows Arc v3, Mini, and v4 to share the same container (and thus databases). But for Arc v3 installed from the App Store (or even TestFlight), it won't be possible to get into that App Group with a Mini built from source.