CatimaLoyalty / Docs

Documentation for developers
https://catimaloyalty.readthedocs.io/en/latest/
0 stars 0 forks source link

Add next card ID to export format? #4

Open kj7rrv opened 2 years ago

kj7rrv commented 2 years ago

Right now, if you create a card, delete it, export your cards, import them into another device, and create a new card, it will have the same ID as the deleted card. Would it be possible to fix this by adding the next card ID to use to the bottom of the CSV file? The parser would have to guess the value based on the cards table if it wasn't present.

TheLastProject commented 2 years ago

I think adding a number for which card ID to use next won't solve this. Imagine this situation:

  1. You have 3 cards
  2. You create a new card on your Android phone
  3. You create a new card on your PinePhone

Then you will already have an ID conflict too.

I think we should maybe change the card ID to be something like the UNIX creation timestamp, so there can only be a conflict if you create 2 cards at the exact same second on multiple devices.

kj7rrv commented 2 years ago

Okay, that's a good idea. Probably safe to assume no one will create two cards in one second?