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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleting row => asObservableChangeset #28

Closed
remirobert opened this issue Aug 26, 2016 · 1 comment
Closed

Deleting row => asObservableChangeset #28

remirobert opened this issue Aug 26, 2016 · 1 comment

Comments

@remirobert
Copy link

remirobert commented Aug 26, 2016

Hello,

I have a strange behaviour, I have a observer on for asObservableChangeset :

realm.objects(Message).asObservableChangeset()
   .subscribeNext {result, changes in
         if let changes = changes {
             print("[馃彽馃惞] deleted: \(changes.deleted) inserted: \(changes.inserted) updated: \(changes.updated)")
         } else {
             print("get results result :\(result.count)")
         }
}.addDisposableTo(self.disposeBag)

when I deleted a row, I got a deleted change offset but also an inserted offset.
Also the index is always = 0
Is it normal to receive a inserted index, when I delete a row ?

@icanzilb
Copy link
Member

no I wouldn't say it's normal, do you have a piece of code that can reproduce it?

there's a unit test to show you the expected behavior:

https://github.com/RxSwiftCommunity/RxRealm/blob/master/Example/RxRealm_Tests/RxRealmResultsTests.swift#L105

and the expected result:

https://github.com/RxSwiftCommunity/RxRealm/blob/master/Example/RxRealm_Tests/RxRealmResultsTests.swift#L120

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