Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: TypeError: Cannot use 'in' operator to search for 'contentTopics' in undefined when creating subscription #2022

Closed
dmotz opened this issue May 24, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@dmotz
Copy link

dmotz commented May 24, 2024

This is a bug report

Problem

The current docs indicate this way of subscribing to a topic:

const subscription = await node.filter.createSubscription()
await subscription.subscribe([decoder], callback)

However with the current version of the lib, the internal function shardInfoToPubsubTopics() throws:

TypeError: Cannot use 'in' operator to search for 'contentTopics' in undefined as its argument shardInfo is undefined.

This code worked in previous versions.

I see there is a pubsubTopics field when creating the node but the use case here is dynamic topics not known at the time of constructing the node.

@dmotz dmotz changed the title TypeError: Cannot use 'in' operator to search for 'contentTopics' in undefined when creating subscription bug: TypeError: Cannot use 'in' operator to search for 'contentTopics' in undefined when creating subscription May 24, 2024
@weboko weboko added the bug Something isn't working label May 29, 2024
@weboko weboko self-assigned this May 29, 2024
@weboko
Copy link
Collaborator

weboko commented Jun 5, 2024

Hi @dmotz. That's a good point and we need to update docs to facilitate the change we released couple of weeks ago.

Here is PR with updated docs waku-org/docs.waku.org#199

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

2 participants