You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have two independent widgets. Both do a uow.getDatabase to the same db, collection pair. Both connect to onSet on the data store. When widget #1 updates an item in the collection, it's onSet handler runs, but widget #2's doesn't. The same holds true when widget #2 does the update: widget #1 is not notified.
This breaks our assumption that JsonRestStore instances pointing to the same URL endpoints notify one another of changes. Apparently, they don't.
Tracking (url, mode) -> store pairs and returning existing instances at the uow level or MongoStore level would fix this problem.
The text was updated successfully, but these errors were encountered:
I thought for sure they did. In the code they do a lookup on the service to see if it has already been created. I guess they don't connect back at the store level?
Another possibility would be to connect their onSet methods instead of returning the same object. That way even stores with different modes could communicate. I worry a bit about stores being artificially kept alive by any such mechanism resulting in memory leakage.
What about pub/sub? MongoStore can subscribe to some private topic that it broadcasts whenever one instance detects a CUD change. Other MongoStore instances could then refresh the current query, invoke the proper callback, whatever they need to do.
Or we can just forget the whole thing and say the instances are not linked in any way. If you make a change in one instance, it's up to you to do a refresh in others. Punt.
I have two independent widgets. Both do a uow.getDatabase to the same db, collection pair. Both connect to onSet on the data store. When widget #1 updates an item in the collection, it's onSet handler runs, but widget #2's doesn't. The same holds true when widget #2 does the update: widget #1 is not notified.
This breaks our assumption that JsonRestStore instances pointing to the same URL endpoints notify one another of changes. Apparently, they don't.
Tracking (url, mode) -> store pairs and returning existing instances at the uow level or MongoStore level would fix this problem.
The text was updated successfully, but these errors were encountered: