Skip to content

Unable to detect changes to FileStorageKey from external processesΒ #147

@junpluse

Description

@junpluse

Description

Since version 2.4.0, where FileStorageKey writes became atomic, changes made by external processes (such as a Share Extension) are no longer detected by other processes, and the shared value no longer updates as expected.

You can reproduce this issue with the attached demo project by following these steps:

  1. Open FileStorageKeySyncDemo.xcodeproj in Xcode
  2. Build and run DemoApp1
  3. Enter text in DemoApp1 β†’ the shared value is updated
  4. Build and run DemoApp2 (identical to DemoApp1 except for the bundle identifier)
  5. Enter text in DemoApp2 β†’ the shared value is updated
  6. The change made in step 5 is not reflected in DemoApp1

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

When process A updates the shared value, it should be immediately reflected in process B.

Actual behavior

Even when process A updates the shared value, it is not reflected at all in process B.

Reproducing project

FileStorageKeySyncDemo.zip

Sharing version information

2.4.0

Destination operating system

iOS, macOS

Xcode version information

16.3

Swift Compiler version information

swift-driver version: 1.120.5 Apple Swift version 6.1 (swiftlang-6.1.0.110.21 clang-1700.0.13.3)
Target: arm64-apple-macosx15.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