One notable thing though was how Witty handles database entry pointers under the hood. This caught me when I thought I encountered a bug when fetching data from the database. This can be reproduced below:
- Session 1 fetches an entry in the form of a pointer (let’s call this pointer A) from the database.
- Session 2 then modifies that exact same entry.
- Session 1 then fetches the same entry in the form of a pointer (let’s call this pointer B) from the database.
When reading data from pointer B, it will not reflect the latest modifications that was made in session 2. You will need to remove both pointer A and B and then only create pointer C before pointer C can reflect the changes made in session 2. In short, one will have to deconstruct all pointers referencing to a database entry before the next pointer that references to that entry can reflect its latest version.
I then ended the week with mainly documenting on how to setup the system, along with some simple features.