Skip to content

Conversation

@singhashmeet
Copy link
Contributor

Description of the pull request

...

Why is the change necessary?

...


CC @pusher/mobile

@singhashmeet singhashmeet force-pushed the SubscriptionCountEvent branch from b6f5fdf to 6842c09 Compare July 15, 2022 10:26
@singhashmeet singhashmeet requested review from amad and fbenevides July 15, 2022 10:39
@codecov-commenter
Copy link

codecov-commenter commented Jul 15, 2022

Codecov Report

Merging #331 (5b2f9e3) into master (fc4dd05) will decrease coverage by 0.94%.
The diff coverage is 0.00%.

@@ Coverage Diff @@ ## master #331 +/- ## ============================================ - Coverage 75.14% 74.19% -0.95%  Complexity 346 346 ============================================ Files 50 51 +1 Lines 1955 1980 +25 Branches 149 151 +2 ============================================ Hits 1469 1469 - Misses 422 446 +24  - Partials 64 65 +1 
Impacted Files Coverage Δ
...va/com/pusher/client/channel/impl/BaseChannel.java 83.15% <0.00%> (-10.89%) ⬇️
...nt/channel/impl/message/SubscriptionCountData.java 0.00% <0.00%> (ø)
...ain/java/com/pusher/client/example/ExampleApp.java 0.00% <0.00%> (ø)
...sher/client/example/PresenceChannelExampleApp.java 0.00% <0.00%> (ø)
...usher/client/example/PrivateChannelExampleApp.java 0.00% <0.00%> (ø)
...ent/example/PrivateEncryptedChannelExampleApp.java 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fc4dd05...5b2f9e3. Read the comment docs.

@singhashmeet singhashmeet requested a review from amad July 15, 2022 12:06
@singhashmeet singhashmeet requested a review from amad July 15, 2022 12:10
* @param count
* The latest count of subscribers on the channel.
*/
void onSubscriptionCountChanged(String channelName, int count);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't bring myself to let it go like this. This makes it harder for anyone who wants to upgrade, even if they don't want to use the feature.

I know the way it's currently designed is annoying to work with. But let's create a new interface that extends this.
e.g. ChannelWithSubscriptionCountEventListener

You probably have to add two more interfaces that extend that for private channels too. PrivateChannelWithSubscriptionCountEventListener, PrivateEncryptedChannelWithSubscriptionCountEventListener

It's pretty ugly but at least it doesn't force everyone to change their implementation.

Sorry for the late feedback.

We will need to rethink and redesign how these event listeners are added in the next major release.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SDK is not designed for this to happen elegantly and will complicate the integration process a lot for subscription count.
If not breaking the older implementations is a non-negotiable then I would suggest removing this event listener entirely and renaming the event to pusher:subscription_count so it can be handled with the .bind() function like in JS SDK
What do you think ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants