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

FRC may keep old context after core data stack is nuked #64

Open
rachelhyman opened this issue Dec 11, 2015 · 3 comments
Open

FRC may keep old context after core data stack is nuked #64

rachelhyman opened this issue Dec 11, 2015 · 3 comments
Labels

Comments

@rachelhyman
Copy link

This came up when a fetched results controller would display model objects, but then logging out, killing the app, and restarting/logging in would not display any objects despite them seemingly existing in Core Data. This was due to new objects getting inserted in a different context than the one associated with the FRC. Cc @chillpop

@seanwolter
Copy link
Contributor

@rachelhyman Can you provide any additional information or sample code?
Or is someone Vokal-internal already aware of the details and fixing it?

@rachelhyman
Copy link
Author

Steps to reproduce:

  1. Set up a VOKCollectionDataSource with a collection view
  2. Nuke and reset core data, then set it up again (not sure whether killing the app is integral here). In my case this happened when logging out and logging in, respectively.
  3. Observe that relevant model objects exist e.g. by calling [[VOKCoreDataManager sharedInstance] countForClass:] but that nothing is being fetched or displayed. The fetched results controller of the data source is using a different context than the one objects are being added to.
  4. If you follow the same steps but set up the data source again before fetching, the correct results appear.
    @seanwolter

@seanwolter
Copy link
Contributor

I'm working on a collection view for the sample app. I was unable to reproduce, but I did find a lot of gnarly code in the vokcollectiondatasource. I should have a PR before the end of this week.

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

No branches or pull requests

3 participants