Everything works as expected (in this scenario: 10 Person's entities with lowest name) but when in some other part of App I'm making inserts into Person, fetchLimit is not respected:
listMonitor(_:didInsertObject:toIndexPath:) is called for every inserted entity, while listMonitor(_:didDeleteObject:fromIndexPath:) is not called at all.
self.monitor.numberOfObjectsInSection(0) returns more than 10
Originally created by @zalogatomek on GitHub (Sep 27, 2017).
So, I have some `ListMonitor`, `Where`, `ListObserver` (`self`)
```swift
self.where = Where("name != nil")
self.monitor = CoreStore.monitorList(From<Person>(), self.where, OrderBy(.ascending("name")))
self.monitor.addObserver(self)
```
Then, I'm performing `refetch()` with `Tweak`:
```swift
self.tweak = Tweak({ (fetchRequest) in
fetchRequest.fetchLimit = 10
})
self.monitor.refetch([self.where, self.tweak])
```
Everything works as expected (in this scenario: 10 `Person`'s entities with _lowest_ name) but when in some other part of App I'm making inserts into `Person`, fetchLimit is not respected:
- `listMonitor(_:didInsertObject:toIndexPath:)` is called for every inserted entity, while `listMonitor(_:didDeleteObject:fromIndexPath:)` is not called at all.
- `self.monitor.numberOfObjectsInSection(0)` returns more than 10
@JohnEstropia commented on GitHub (Oct 10, 2017):
Unfortunately this is a [bug in NSFetchedResultsController since 2011](https://stackoverflow.com/questions/4858228/nsfetchedresultscontroller-ignores-fetchlimit) and there's not much we can do here aside from reporting it to Apple.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @zalogatomek on GitHub (Sep 27, 2017).
So, I have some
ListMonitor,Where,ListObserver(self)Then, I'm performing
refetch()withTweak:Everything works as expected (in this scenario: 10
Person's entities with lowest name) but when in some other part of App I'm making inserts intoPerson, fetchLimit is not respected:listMonitor(_:didInsertObject:toIndexPath:)is called for every inserted entity, whilelistMonitor(_:didDeleteObject:fromIndexPath:)is not called at all.self.monitor.numberOfObjectsInSection(0)returns more than 10@JohnEstropia commented on GitHub (Oct 10, 2017):
Unfortunately this is a bug in NSFetchedResultsController since 2011 and there's not much we can do here aside from reporting it to Apple.