Skip to content

@FetchAll property wrapper not working in Reducers for swift-dependencies >= 1.10.1 #417

@OddMagnet

Description

@OddMagnet

Description

Before swift-dependencies 1.10.1 and greater I was able to have a TCA Reducer with a @FetchAll property, which would work as expected when used in a preview.

After updating to 1.10.1 or newer this doesn't work anymore.

I noticed this when I set up a new project and couldn't get the same behavior as in an older project, see this Discussion: pointfreeco/sqlite-data#395

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

FetchAll in a Reducer also works in Previews

Actual behavior

FetchAll in a Reducer does not work in Previews

Steps to reproduce

  1. Check out this example repository: https://github.com/OddMagnet/swift-dependencies-bug-example
  2. Build and verify that the FetchAll works in preview
  3. Change swift-dependencies version to 1.10.1
  4. Trust Macros again, build and try to view the preview
  5. Preview does not show the fetched data anymore

Dependencies version information

1.10.1

Destination operating system

iOS 26.2

Xcode version information

26.2

Swift Compiler version information

swift-driver version: 1.127.15 Apple Swift version 6.2.4 (swiftlang-6.2.4.1.4 clang-1700.6.4.2)
Target: arm64-apple-macosx26.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions