uprtcl / js-uprtcl

Libraries, tools and modules to create _Prtcl web apps

Home Page:http://www.uprtcl.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

EveesService updatePerspectiveData reentrancy

pepoospina opened this issue · comments

commented

EveesService.updatePerspectiveData() build a head update computed on the current client head.

However, if a new call to this method is received before the current head has been updated, two heads will be built on top of the same parent head.

We should build a queue of data updates and build a queue of head updates so that new data updates are built on top of the existing head updates being computed.

Its pretty tricky as the head of the new update must await for the previous head update to be ready in order to be computed.

Then, we should also support debounce, were consecutive calls to update the data of the same perspective overwrite the privious one if they are done before a time deadline.

I'm postponing this for its complexity, meaning that, for now, applications should take care of not making concurrent calls to updatePerspectiveData, unless they want them to be debounced.