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

Subscription breaks after Firebase.Database.Streaming.FirebaseEventType.Delete #275

Open
quibenefacit opened this issue Jan 24, 2022 · 2 comments

Comments

@quibenefacit
Copy link

quibenefacit commented Jan 24, 2022

This problems occurs in version 4.0.7. I haven't tried it with any other versions. Xamarin.Forms version is 5.0.0.229.

I have the following subscription:

firebaseClient.Child("Products")
     .AsObservable<Prod>()
     .Where(item => (item.Object.uid == _thisUid)
     .Subscribe(obs => {
         switch(obs.EventType) {
                case Firebase.Database.Streaming.FirebaseEventType.InsertOrUpdate:
                            var m = obs.Object;
                                prodlist.Add(new Prod() {
                                    Name = m.uniquename,
                                });
                            }
                break;
                case Firebase.Database.Streaming.FirebaseEventType.Delete:
                            var m2 = obs.Object;
                            foreach (var p in prodlist) {
                                if(p.uniquename== m2.uniquename) prodlist.Remove(t);
                            } 
                break;
         }
         PropertyChanged(this, new PropertyChangedEventArgs(nameof(prodlist)));
    }

Any number of actions of type Firebase.Database.Streaming.FirebaseEventType.InsertOrUpdate work fine until the first action Firebase.Database.Streaming.FirebaseEventType.Delete. After the latter gets processed, no subsequent subscription events get fired.

@danieljustus32
Copy link

Hi,

Did you ever make any progress on this? I'm facing the same issue

@TathataHY
Copy link

you can reply this method, with the Subscribe function
#162 (comment)

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

3 participants