Rory-Reid / Basemix

An application for UK rat breeders
https://basemix.app
MIT License
0 stars 0 forks source link

Android - Crash after exporting db #6

Closed Rory-Reid closed 9 months ago

Rory-Reid commented 1 year ago

You can export the database on android but doing so will give you an error telling you to reload the application.

Need to find out why.

Rory-Reid commented 1 year ago

This appears to be an issue in certain circumstances inside of the MAUI Community Toolkit file saver. After saving, it tries to construct the filepath representing where the file was saved to in order to return that value to the calling code, but this path construction logic, for some reason, throws an index out of bounds exception.

I think this happens because it's trying to access a very specific array value in the current path (like index 1 or something) and in some circumstances the current path doesn't have that many parts OR maybe isn't set? I've added a workaround in basemix where we swallow the error (because we don't need the path) - will have to try submit a ticket on the file saver for this before resolving.

Rory-Reid commented 1 year ago

Resolved with some try/catches, as all good code is.

Rory-Reid commented 1 year ago

Actually, let's try feed this back into the lib.

Rory-Reid commented 1 year ago

Might actually be invalidated by whatever we decide to do for #13 - keep an eye on this but it's really low priority.

Rory-Reid commented 9 months ago

Not using FileSaver to export now