Project MAD
Testing
ID Issue
The first test I conducted was creating and deleting of our bookings.
At first we were trying to have sequential booking IDs.
However, we ran into a big issue due to using sequential IDs.
The way we created new booking IDs was by counting the current amount of entries,
then using the count, incremented by 1, concatenated with a "B" to give us the result B+count.
So if there was 3 bookings created, when creating a new booking the count would be 3,
incremented by one would give us 4.
So the new booking ID would become B4.
Now lets say we deleted booking B3 and we try to create a new booking.
Well since we still have booking B1, B2, and B4, our count will be 3,
incremented by one to equal 4.
So again our new ID would become B4.
Since B4 is already created a new entry will not be created and the data will not be updated either.
As a result of this, no new entries can ever be created.
Due to the count forever being stuck at 3 entries.
The only fix is for someone with access to the database to manually enter in a B3 booking.
Our permanent solution was to change to the use of firebase push IDs.
These IDs are automatically generated and are not sequential.