Git Product home page Git Product logo

swiftuifetchrequestbug's Introduction

Bug Explanation

When a SwiftUI View is presented that uses @FetchRequest and an update occurs while it is presented, it forever retains the backing SwiftUI.FetchController. This is a problem if you go to remove the persistent stores as creating a new persistent store and having changes on that will crash the outstanding fetch controller that has stale assets.

Steps to reproduce bug

  1. Tap "Open SwiftUI View" (At this point observe in memory debugger that 1 instance of SwiftUI.FetchController exists without a retain cycle)
  2. Tap "Add new person" in sheet (Now that same object exists but now has a retain cycle)
  3. Dismiss the sheet by swiping down
  4. Tap Clear DB (wait for "Persistent stores reloaded" in console)
  5. Tap "Open SwiftUI View"
  6. Tap "Add new person" in sheet (Observe Core Data throwing an exception)
Before Adding Entity After Adding Entity
Screenshot 2024-01-04 at 2 02 09 PM Screenshot 2024-01-04 at 2 02 37 PM

swiftuifetchrequestbug's People

Contributors

lucasderraugh avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.