Skip to content

How to update Firebase flag for user terms

  1. Plan a time when web team releases the new version of terms, remember the time

  2. Insert a new version of the specified document in terms TermsVersion table, the [EffectiveFrom] should equal or later than the time in step1

  3. Web team should update the terms at the specified time.

  4. After web team updates the terms, run the job Minority.Terms.UpdateTerms.Job, remember that this job takes several hours to finish. (a problem is we should launch the new app version after the job is successfully finished so that clients will accept the terms before they use new feature)

The whole flow can be improved:
1. Now we only have one url for the latest version for each document, that means we need to coordinate the time web team update the document and [EffectiveFrom] in database, instead we can have one url for each version, so web team can upload the document to the url of specified version and we can show it to clients at specified time.

  1. We can create a table in terms db to store Firebase flag status for each user. After UpdateUserTerms endpoint is called, we update the flag to false. When we run the Minority.Terms.UpdateTerms.Job, no need to update the flag for users whose flag is still true. For most users the flag keeps true, no need to update the flag again and again. Currently we need 50 hours because each time we will update the flag for inactive users. If we improve this, the time can be reduced dramatically.