Error saving and retrieving data from TinyDB

It's possible to avoid the pain of having to synchronize your global variables and their TinyDB copies at app startup and save time.

The secret here is to totally eliminate global variables, replacing them with getter/setter procedures that dynamically access TinyDB or component lists behind the scenes.

Before replacing global variables with procedures:

After replacing global variables with procedures: