shutro 0.3.4 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -734,7 +734,12 @@ async function applyCommands(host, model, parentId, key, commands, mode) {
|
|
|
734
734
|
}
|
|
735
735
|
parentValues.set(key, [...current]);
|
|
736
736
|
internals.trigger(model.name, key, [parentId]);
|
|
737
|
+
// The junction table changed: a change event names the key, even when no column of the row was written (a write
|
|
738
|
+
// with scalars too merges its keys into the same event).
|
|
739
|
+
if (mode === 'write' && !sameIds(linked, current))
|
|
740
|
+
recordChange(internals, model, 'write', [parentId], [key]);
|
|
737
741
|
}
|
|
742
|
+
const sameIds = (a, b) => a.length === b.size && a.every((id) => b.has(id));
|
|
738
743
|
// -------------------------------------------------------------------------------------------------- flush
|
|
739
744
|
/** Writes dirty records of `modelName` (or all models) in one `UPDATE … FROM unnest(...)` per (model, field set). */
|
|
740
745
|
export async function flushDirty(host, modelName) {
|
package/package.json
CHANGED