Skip to content

Commit b6d1cb8

Browse files
committed
Fix DEPRECATE_RELATIONSHIP_REMOTE_UPDATE_CLEARING_LOCAL_STATE case
1 parent 6ff1771 commit b6d1cb8

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

packages/graph/src/-private/operations/replace-related-records.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ function replaceRelatedRecordsRemote(graph: Graph, op: ReplaceRelatedRecordsOper
272272
// no change has occurred to preserve the legacy behavior
273273
relationship.definition.kind === 'hasMany' &&
274274
relationship.definition.resetOnRemoteUpdate !== false &&
275-
diff.changed
275+
(diff.changed || wasDirty)
276276
) {
277277
const deprecationInfo: {
278278
removals: StableRecordIdentifier[];

tests/ember-data__graph/tests/integration/graph/diff-preservation-test.ts

-6
Original file line numberDiff line numberDiff line change
@@ -821,12 +821,6 @@ module('Integration | Graph | Diff Preservation', function (hooks) {
821821
});
822822
});
823823

824-
// we access these relationships so that we do not fall victim
825-
// in this test to laziness optimizations where calcs are not made
826-
// if the data is not accessed
827-
graph.getData(appIdentifier, 'configs');
828-
graph.getData(appIdentifier, 'namespaces');
829-
830824
// mutate app:1.configs, adding config:5
831825
// mutate app:1.namespaces, adding namespace:5
832826
store._join(() => {

0 commit comments

Comments
 (0)