redis-oplog: Optimistic UI bug when updating user profile
I’ve discovered a bug with optimistic ui when I update the user profile. The update ddp message is sent after the method result message, like in #51.
I’ve created a reproduction here:
https://github.com/maxnowack/meteor-redisoplog-latencycompensation/tree/user-profile
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 3
- Comments: 20 (18 by maintainers)
Commits related to this issue
- Fixes #227 - accounts-base was executed before redis-oplog due to dependency — committed to cult-of-coders/redis-oplog by theodorDiaconu 6 years ago
- Fixes #227 — committed to cult-of-coders/redis-oplog by theodorDiaconu 6 years ago
- Fixed #227 - removed dependencies for publish-context — committed to cult-of-coders/redis-oplog by theodorDiaconu 6 years ago
Nice, few more bugs to go, and maybe ObjectId support, and it’ll be good for launch!
It is because Meteor loads accounts-base before redis-oplog, even if you put redis-oplog on top, maybe because of a weird dependency tree? Before actually getting the chance to modify publish, by the time we modify it, the universal publication has already been published.
After digging I found the culprit: https://github.com/rclai/meteor-collection-extensions/blob/master/package.js#L39
We are using:
dburles:mongo-collection-instanceswhich users that package above, so we can identify a collection by it’s name. And it has (for an unknown reason still) a weak dependency on accounts-base. Which breaks our oplog, and results intoobserveChangesthe default functionality of publish function, which is caught by our oplog but not via a standardpublish/publishWithRedis.The solution is to find another way to get the collection by it’s name.