Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix @Observable property writes skipped when new value is == old value - #25

#25
Merged
marcprux merged 1 commit into
skiptools:mainskiptools/skip-model:mainfrom
dfabulich:observed-referential-equalitydfabulich/skip-model:observed-referential-equalityCopy head branch name to clipboard
Jul 25, 2026
Merged

Fix @Observable property writes skipped when new value is == old value#25
marcprux merged 1 commit into
skiptools:mainskiptools/skip-model:mainfrom
dfabulich:observed-referential-equalitydfabulich/skip-model:observed-referential-equalityCopy head branch name to clipboard

Conversation

@dfabulich

@dfabulich dfabulich commented Jun 10, 2026

Copy link
Copy Markdown
Member

Compose mutableStateOf uses structural equality by default, so assigning a new dictionary (or other collection) to an @Observable property was ignored when Equatable said nothing changed.

Now, we use referential equality, so assignment always updates the backing state.

Fixes #24

Skip Pull Request Checklist:

  • REQUIRED: I have signed the Contributor Agreement
  • REQUIRED: I have tested my change locally with swift test
  • OPTIONAL: I have tested my change on an iOS simulator or device
  • OPTIONAL: I have tested my change on an Android emulator or device

  • AI was used to generate or assist with generating this PR. Please specify below how you used AI to help you, and what steps you have taken to manually verify the changes.

Tested using skiptools/skipapp-showcase#110

@cla-bot cla-bot Bot added the cla-signed label Jun 10, 2026
Compose `mutableStateOf` uses structural equality by default, so assigning a new dictionary (or other collection) to an `@Observable` property was ignored when `Equatable` said nothing changed.

Now, we use referential equality, so assignment always updates the backing state.

Fixes skiptools#24
@dfabulich
dfabulich force-pushed the observed-referential-equality branch from 5f5cb6c to 91ef61b Compare July 25, 2026 19:02
@dfabulich
dfabulich requested a review from marcprux July 25, 2026 19:03
@marcprux
marcprux merged commit 0055d6a into skiptools:main Jul 25, 2026
3 checks passed
@marcprux

Copy link
Copy Markdown
Member

Sorry for the delayed review — this fell off the radar somehow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@Observable dictionary replace ignored when struct values compare equal

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.