pusher / pusher-js

Pusher Javascript library
http://pusher.com
MIT License
2.11k stars 374 forks source link

`paramsProvider` arguments #835

Open tdeo opened 2 months ago

tdeo commented 2 months ago

Do you want to request a feature or report a bug?

This would be a new feature request

What is the current behavior?

Today, it's possible to use paramsProvider to send additional information during the channelAuthorization call. When using more and more different channels, this is starting to grow our payload significantly because the paramsProvider isn't aware of the channel being subscribed to and have to return the params for all possible options to the backend, and the backend can then look at the appropriate params depending on the channel being authorized, by looking at the channel_name parameter.

What is the expected behavior?

I think it would make our implementation quite easier if paramsProvider could be provided with the params argument at the moment it's called: https://github.com/pusher/pusher-js/blob/ed900f8d4fc121cb2c7e20809a3cac8e3249d812/src/core/auth/channel_authorizer.ts#L28. This way we could serialize only the appropriate payload to the backend

Which versions of Pusher, and which browsers / OS are affected by this issue? Did this work in previous versions of Pusher? If so, which?

Using pusher 8.3.0, same behavior on current master