Skip to content

Conversation

@ra1028
Copy link
Owner

@ra1028 ra1028 commented Aug 24, 2022

Pull Request Type

  • Bug fix
  • New feature
  • Refactoring
  • Documentation update
  • Chore

Description

  • Ensure that the atom is registered for read, reset, and refresh even if it has no downstream.
  • Fixes a problem that AtomViewContext doesn't release if it's retained by a Binding.

Impact on Existing Code

Fixes the bugs that describe above.

XCTAssertEqual(observer.assignedAtomKeys, [AtomKey(atom)])
XCTAssertEqual(observer.changedAtomKeys, [AtomKey(atom)])
XCTAssertTrue(observer.unassignedAtomKeys.isEmpty)
XCTAssertEqual(observer.unassignedAtomKeys, [AtomKey(atom)])
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

read now register the atom and release immediately if it has no downstream.

XCTAssertTrue(observer.unassignedAtomKeys.isEmpty)
XCTAssertEqual(observer.assignedAtomKeys, [dependency0Key, dependency1Key])
XCTAssertEqual(observer.changedAtomKeys, [dependency0Key, dependency1Key])
XCTAssertEqual(observer.unassignedAtomKeys, [dependency1Key])
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Terminated transaction now falls back to read and it registers and releases immediately.

@ra1028 ra1028 merged commit df7d6cc into main Aug 24, 2022
@ra1028 ra1028 deleted the feat/fix-atom-lifecycle branch August 24, 2022 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants