Skip to content

ListenerRegistration should implement IDisposable #746

Closed

Description

@Thaina

Please fill in the following fields:

Unity editor version: All
Firebase Unity SDK version: At least 6.15.2 and lower
Source you installed the SDK (.unitypackage or Unity Package Manager): UPM
Firebase plugins in use (Auth, Database, etc.): FireStore

Please describe the issue here:

Some 3rd party made to be general listener (honestly https://github.com/neuecc/UniRx)

I want to use FireStore Listener API with it but then ListenerRegistration need to implement IDisposable for compatible with it

Could you please add it like this

	public sealed class ListenerRegistration : IDisposable
	{
		public Task ListenerTask { get; }

		public void Stop();
		public void Dispose() => listener.Stop();
	}

So I could use UniRX like so

	Observable.Create<QuerySnapshot>((observer) => {
		return colReference.Listen((snap) => observer.OnNext(snap));
	});

Activity

  1. google-oss-bot commented on Aug 5, 2020

    @google-oss-bot

    This issue does not seem to follow the issue template. Make sure you provide all the required information.

  2. self-assigned this
    on Aug 5, 2020
  3. rafikhan commented on Aug 5, 2020

    @rafikhan

    Thanks for reporting this. We discussed this internally and plan to work on this in a future release.

    b/162954556

  4. removed their assignment
    on Aug 5, 2020
  5. Thaina commented on May 25, 2021

    @Thaina
    ContributorAuthor

    @rafikhan Have this request made any progressed?

  6. dconeybe commented on May 25, 2021

    @dconeybe

    Unfortunately, there is no update to share. For now, you can work around this by wrapping the ListenerRegistration object returned from Listen() in a custom object that you create that implements IDisposable and whose Dispose() method calls listener.Stop().

  7. Thaina commented on May 25, 2021

    @Thaina
    ContributorAuthor

    @dconeybe That's what I have done so far and the point is I want to remove this pollution from my code

  8. dconeybe commented on May 25, 2021

    @dconeybe

    Understood. I apologize for the delay and the obvious annoyance this is causing. I'll update this issue once the fix is ready for release which, unfortunately, I do not have any timeline for at this point.

  9. Thaina commented on Jun 16, 2021

    @Thaina
    ContributorAuthor

    @dconeybe This was already more than half a year for just 1 second to attach 2 lines of code. Even it cannot be released it should have been done and guarantee to available in the next version already without the need promising any timeline

  10. dconeybe commented on Jun 16, 2021

    @dconeybe

    @Thaina I totally get your frustration. It is literally a 2-line fix and it seems ridiculous that it would take months to get fixed. The work has been prioritized but, since this bug has a workaround, it has not received attention yet. Unfortunately, I still can't make any statements about which version of the Unity SDK will contain the fix but I will post a comment to this bug once it's available.

  11. dconeybe commented on Jun 22, 2021

    @dconeybe

    Update: The fix for this issue was submitted today by @ehsannas (cl/380662743 for Googlers). It will be included in the next Unity SDK release, planned to be version 8.1.0.

  12. Thaina commented on Jun 22, 2021

    @Thaina
    ContributorAuthor

    Thank you very much

  13. dconeybe commented on Jul 20, 2021

    @dconeybe

    The fix has been included in yesterday's Unity SDK 8.1.0 release.

    https://firebase.google.com/support/release-notes/unity#version_810_-_july_19_2021

  14. locked and limited conversation to collaborators on Aug 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions