Skip to content

fix: watch attributes only run getters/setters for the method they define#579

Open
anatolzak wants to merge 1 commit into
tywalch:masterfrom
anatolzak:worktree-fix-schema-has-watchers-read-write
Open

fix: watch attributes only run getters/setters for the method they define#579
anatolzak wants to merge 1 commit into
tywalch:masterfrom
anatolzak:worktree-fix-schema-has-watchers-read-write

Conversation

@anatolzak

Copy link
Copy Markdown
Contributor

closes #578

@netlify

netlify Bot commented Jun 6, 2026

Copy link
Copy Markdown

Deploy Preview for electrodb-dev canceled.

Name Link
🔨 Latest commit ed72f88
🔍 Latest deploy log https://app.netlify.com/projects/electrodb-dev/deploys/6a24429de6671100078fb0da

@anatolzak

Copy link
Copy Markdown
Contributor Author

@tywalch Could you please take a brief look at this? the tldr is when applying attribute mutations for watchers, we now check the watch translations for each method (get versus set) to avoid triggering watcher logic for a method that the attribute doesn't define. During a read get, a watcher that only has a set (the most common case, such as an updatedAt timestamp) is not treated as a watcher at all. Therefore, it is neither force evaluated nor leaked into the result as undefined

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.

Read operations return undefined for setter-only watch attributes that aren't stored on the item

1 participant