CatimaLoyalty / Android

Catima, a Loyalty Card & Ticket Manager for Android
https://catima.app
GNU General Public License v3.0
874 stars 151 forks source link

Error importing from Fidme #1005

Closed noraj closed 2 years ago

noraj commented 2 years ago

I have the following error when trying to import he fidme zip: fidme-export-request-2022-09-02-16-39-18.zip.

protect.card_locker.FormatException: No card ID listed, bit is required.

I have 13 cards in loyalty_programs.csv.

But one of the card is expired so the column with the card ID is empty:

KFC;Etudiants;2019-09-13 15:23:08 UTC;;;

It looks like it's what make the import fails (Update: confirmed, removing the line with the card with an empty ID and the import work).

Expected behavior: skip card with no ID or create a card with all info with an empty ID too.

TheLastProject commented 2 years ago

Interesting behaviour on Fidme's side. I find it surprising they'd choose to empty the ID when a card expires instead of setting some expired flag or something.

Thanks for your research, this should be quite an easy fix. I'll fix it in the coming days if nobody else beats me to it.

TheLastProject commented 2 years ago

And with fix I mean: ignore these expired cards. Catima's design considers the ID a required field because a card is pretty useless without any value. I could also put some dummy "Empty card in Fidme" or something text there, but I think that'll just confuse more users than leaving an expired card out of the import.

TheLastProject commented 2 years ago

Fixed in e0650bc6f95f7e8ea21d26c907219ca97a4fc4e0.