So I have this situation where I have these formulas in my database that 
are based on the current date. Whenever a record is viewed, the formula is 
evaluated and the value in the database is updated with the result.

For example, calculating someone's age based on their birth date. Each time 
you view the record, the person is just a little bit older. The granularity 
of the calculation can be down to the second, so it's not used just for 
ages, which could easily be updated only once a day if that were the only 
use case.

Now that I have peer-to-peer sync working nicely, I've come across this 
situation.  When replication completes, I refresh the screen with the 
updated data from the remote peer, thus causing the age calculation 
formulas to be evaluated and hence updating the data in the database again. 
And now I get an infinite game of ping-pong happening with the replicator.

I'm not quite sure how to handle this situation since I do want the results 
of the calculation to be synced, but I don't want the refresh to trigger 
the calculation again. 

Any interesting strategies to handle this kind of situation would be great 
to hear about.

Thanks,

Brendan

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/f470fae2-c607-4ae8-8367-bf01bf54ed5f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to