Skip to content

Store scoping issue with ForEach #2846

Open
@ddanilyuk

Description

Description

Hi! Found an issue (i think) with scoping stores for lists.

Here is an example of a memory graph after opening and closing a feature with a List 10 times. After all this opening and closing, we have 70 cached stores of non-present rows. However, we should not have any of it since this feature is not present, isn't it?
Screenshot 2024-02-18 at 01 04 56
This could potentially become a performance issue in large-scale apps.

Do we need a cleanup mechanism for the stores when the presented view closes?
Or maybe we have a possibility to remove caching when using lists?

Repo with issue: [link]

Checklist

  • I have determined whether this bug is also reproducible in a vanilla SwiftUI project.
  • If possible, I've reproduced the issue using the main branch of this package.
  • This issue hasn't been addressed in an existing GitHub issue or discussion.

Expected behavior

No response

Actual behavior

No response

Steps to reproduce

No response

The Composable Architecture version information

1.8.0

Destination operating system

iOS 17

Xcode version information

15.2

Swift Compiler version information

No response

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working due to a bug in the library.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions