Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/swift-lemons-rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'contexture-client': patch
---

Revert onUpdateByOthers change
15 changes: 8 additions & 7 deletions packages/client/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,14 @@ export let ContextTree = _.curry(
_.map(snapshot),
_.find({ path: snapshot(event.path) })
)(updatedNodes)
await Promise.all(
_.map((n) => {
// When updated by others, force replace instead of merge response
extend(n, { forceReplaceResponse: true })
runTypeFunction(types, 'onUpdateByOthers', n, actionProps)
}, _.remove({ path: snapshot(event.path) }, updatedNodes))
)
if (!affectsSelf)
await Promise.all(
_.map((n) => {
// When updated by others, force replace instead of merge response
extend(n, { forceReplaceResponse: true })
runTypeFunction(types, 'onUpdateByOthers', n, actionProps)
}, updatedNodes)
)

// If disableAutoUpdate but this dispatch affects the target node, update *just* that node (to allow things like paging changes to always go through)
// The assumption here is that any event that affects the target node would likely be assumed to take effect immediately by end users
Expand Down
Loading