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

Fatal error on WeakBox<BaseSubscriptionListener> #173

Closed
akuzminskyi opened this issue May 14, 2024 · 5 comments
Closed

Fatal error on WeakBox<BaseSubscriptionListener> #173

akuzminskyi opened this issue May 14, 2024 · 5 comments

Comments

@akuzminskyi
Copy link

Duplicate elements of type 'WeakBox<BaseSubscriptionListener>' were found in a Set.

SCR-20240514-eln
Screenshot 2024-05-14 at 11 23 09

Maybe this post can help.

PubNub SDK Version 6.2.3(yes, this is not the latest).

@jguz-pubnub
Copy link
Contributor

@akuzminskyi could you show how you add listeners to the PubNub instance?
And how do you store SubscriptionListener variables? Are they strong references?

@akuzminskyi
Copy link
Author

akuzminskyi commented May 15, 2024

Are they strong references?

yes, and I think maybe the same listener can be trying to add twice.

if this is the case, shouldn't we ignore it and instead of:

elements.update(with: WeakBox(element))
elements.insert(WeakBox(element))

@akuzminskyi
Copy link
Author

I think the issue is described here. so I think this issue is with the SDK implementation.

@jguz-pubnub
Copy link
Contributor

I was unable to reproduce this error on 6.2.3 when attempting to add the same listener more than once. I will investigate possible new scenarios and update you on my findings in this thread

@jguz-pubnub
Copy link
Contributor

Fixed in 7.3.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants