collection.insert() is not updating the redis subscription (no event "i" received by subscription manager)
See original GitHub issueMeteor version: 1.6.1 Redis Oplog version: 1.2.7 Mongo DB version: 3.4.10 Redis version: 4.0.8
Problem: Inserting a new record in a collection does not update the subscription
Representative code:
Notifications.insert(data, { namespace: 'userId::' + userId });
But updating the records work. With debug on, I can see that the subscription manager has no event “i” when inserting records.
I20180328-08:00:34.303(8)? [1522195234303] - [RedisSubscriptionManager] Subscribing to channel: userId::ccCN3JoGPSiWYyTf8::notifications
I20180328-08:00:55.231(8)? [1522195255231] - [RedisSubscriptionManager] Received event: "u" to "userId::ccCN3JoGPSiWYyTf8::notifications"
As of now, my simple remedy is to immediately update the record after inserting it so that it will update the subscription.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
GraphQL subscriptions with Redis Pub Sub
The package introduced there uses an in-memory event system to re-run subscriptions, so there is no way to share subscriptions and publishes ...
Read more >Error message while `yum update' "This system is registered ...
Any yum (update/install) command returns "This system is registered to Red Hat Subscription Management, but is not receiving updates.
Read more >Redis keyspace notifications
Keyspace notifications allow clients to subscribe to Pub/Sub channels in order to receive events affecting the Redis data set in some way.
Read more >How to configure Azure Cache for Redis | Microsoft Learn
Understand the default Redis configuration for Azure Cache for Redis and learn ... Select Events to add event subscriptions to your cache.
Read more >Pub/Sub | Redis
Aside from data storage, Redis can be used as a Publisher/Subscriber platform. ... is put into subscriber mode and no commands can be...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@rj-david had a quick look at your repo.
The issue is related to
aldeed:collection2
/aldeed:collection2-core
interacting withcultofcoders:redis-oplog
TLDR quickfix put
aldeed:collection2
at the TOP of your.meteor/packages
(aboveredis-oplog
).OR, slightly more robust:
Explanation
aldeed:collection2
does not pass options fromCollection.insert(doc, options)
down to the_overriden.insert
So when you perform
Notifications.insert(doc, {namespace: 'userId::' + userId})
thenamespace
is not actually reaching redis-oplog.Note, that
redis-oplog
doesn’t pass the options down either so the easy solution (puttingaldeed:collection2
first) means that you can’t pass options to collection2 likeCollection.insert(doc, {validate: false})
…So probably better to go with
.configureRedisOplog
on the collection…Thank you @rj-david I will book this week time to sweep all the bugs from it!