Closed nazrinharris closed 1 year ago
Methods to check version before execution (all write methods in <any>Repository
:
AuthRepository
ProduceManagerRepository
FarmShopManagerRepository
In ProduceManagerRepository, it seems like Firestore doesn't properly block admins from creating produce with an app version lower than minimum.
Actually, it seems like the isAppVersionAllowed()
in rules doesn't really work
Should be done with e9b143f
Basically, the database now properly reject writes (provided that the user uses app version 0.3.2 and above where custom claims will be implemented), but there will not be a beautiful error message, just a simple permission denied. I will need to implement this version checking client side.
I'm thinking of simply having a new collection called
configs
and have a document calledapp-meta
, and having a fieldminimum-app-version
. Then whenever there is a major data structure change, this field (and the field in security rules) will be changed.This will also open a possibility to have a
latest-version
, and the app will compare against this field to suggest the user to update the app.Firebase Remote Config seems like a good solution for this rather than a document in firestore, here's the general overview of steps I need to take.
isAppVersionAllowed()
method in a seperateAppVersionHelper