App freezes when tapping a navigation link

I have two main models, House and Expense. On the home page I show a list of the three most recent expenses using the following query:

var descriptor = FetchDescriptor<Expense>(predicate: #Predicate { $0.houseID == house.id }, sortBy: [SortDescriptor(\.date, order: .reverse)])
descriptor.fetchLimit = 3
_recentExpenses = Query(descriptor)

I have a NavigationLink that takes you to the full list of expenses:

NavigationLink {
  ExpenseListView(house: house)
} label: {
  Text("See all")
}

On this page I have a query similar to the previous one, without the fetch limit:

let descriptor = FetchDescriptor<Expense>(
  predicate: #Predicate { $0.houseID == house.id}
)
_expenses = Query(descriptor)

The problem is that when I click on the navigation link to go to the expenses page, the app freezes.

I tried passing the expenses array to the second page instead of invoking another query, but this way the view doesn't update when I update the expenses.

Is there a way to solve this problem? Or a way to pass a Binding of the fetched results?

I have the same issue as well, and the memory usage goes up slowly from 30mb to 600mb+ after tapping on the navigation link.

I'm facing this same exact issue. @absinthe99 were you able to figure out a solution?

Same for me, any solution found?

İt's same for me. Any solution?

App freezes when tapping a navigation link
 
 
Q