redwood
redwood copied to clipboard
[Bug?]: Realtime context typescript error, no redis keys created
What's not working?
Unable to write to redis db when using realtime setup. Using similar code for setting up graphql subscriptions as the demo. Longer post here on discord.
There seems to be an issue with how the context is parsed:
{ context }: { context: { pubSub: NewNotificationChannelType } }
It appears to overwrite the global context?
How do we reproduce the bug?
You'll need a redis instance and secret in your .env file.
SESSION_SECRET = ...
REDIS_URL="redis://"
DbAuth is installed so you just sign up as a test user and log in. The home page has a button that increments a value, each time the resolver will publish a notification successfully. This part of realtime subscriptions work. The notification shows up and works properly with pubSub.
However, if you go to the resolver points.ts you'll notice a typescript error. You'll also notice that context.currentUser doesn't exist. When you increment the points and the resolver creates the record, there are no keys in the redis db even though it's set up in the realtime.ts file.
What's your environment? (If it applies)
Redwood 8.0.0-rc.1279
Windows 10
Are you interested in working on this?
- [ ] I'm interested in working on this