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

Most upvoted comments

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-instances which 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 into observeChanges the default functionality of publish function, which is caught by our oplog but not via a standard publish/publishWithRedis.

The solution is to find another way to get the collection by it’s name.