waku-org / js-waku

JavaScript implementation of Waku v2
https://js.waku.org
Apache License 2.0
162 stars 41 forks source link

feat(filter)!: limit filter subscriptions to use a single decoder #1981

Closed adklempner closed 2 weeks ago

adklempner commented 2 months ago
This is a **bug report/feature request/support request/change request** ## Problem

The subscribe function for filter accepts either a single decoder or an array of decoders. This leads to a lot of overhead for the library consumer when handling the response: it might fail before even attempting a subscription, all subscriptions requests might fail, some might fail and some succeed, or all succeed. It's cleaner for the function to accept a single decoder and respond with a single failure or success.

Proposed Solutions

Refactor subscribe function in filter to only accept a single decoder

Notes

weboko commented 2 months ago

This issue proposes a solution to the problem of ambiguity of error handling when we don't have fail or not fail which happens because of a need to provide support to multiple decoders.

@vpavlin @hackyguru do you think we should continue supporting ability to subscribe to multiple decoders?

weboko commented 2 weeks ago

As we don't have clear vision on this one - let's postpone and make a change in scope of https://github.com/waku-org/js-waku/issues/2034 if needed.

Closing this for now.