Skip to content

Commit ff321c0

Browse files
committed
fixup log
1 parent 7407a41 commit ff321c0

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

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

+15-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { deprecate } from '@ember/debug';
22

3-
import { LOG_METRIC_COUNTS } from '@warp-drive/build-config/debugging';
3+
import { DEBUG_RELATIONSHIP_NOTIFICATIONS, LOG_METRIC_COUNTS } from '@warp-drive/build-config/debugging';
44
import { DEPRECATE_RELATIONSHIP_REMOTE_UPDATE_CLEARING_LOCAL_STATE } from '@warp-drive/build-config/deprecations';
55
import { DEBUG } from '@warp-drive/build-config/env';
66
import { assert } from '@warp-drive/build-config/macros';
@@ -218,10 +218,13 @@ function replaceRelatedRecordsRemote(graph: Graph, op: ReplaceRelatedRecordsOper
218218
if (relationship.additions?.has(identifier)) {
219219
relationship.additions.delete(identifier);
220220
} else {
221-
if (!relationship.isDirty) {
222-
console.log(
223-
`setting relationship to dirty because the remote addition was not in our previous list of local additions`
224-
);
221+
if (DEBUG_RELATIONSHIP_NOTIFICATIONS) {
222+
if (!relationship.isDirty) {
223+
// eslint-disable-next-line no-console
224+
console.log(
225+
`setting relationship to dirty because the remote addition was not in our previous list of local additions`
226+
);
227+
}
225228
}
226229
relationship.isDirty = true;
227230
}
@@ -234,10 +237,13 @@ function replaceRelatedRecordsRemote(graph: Graph, op: ReplaceRelatedRecordsOper
234237
if (relationship.removals?.has(identifier)) {
235238
relationship.removals.delete(identifier);
236239
} else {
237-
if (!relationship.isDirty) {
238-
console.log(
239-
`setting relationship to dirty because the remote removal was not in our previous list of local removals`
240-
);
240+
if (DEBUG_RELATIONSHIP_NOTIFICATIONS) {
241+
if (!relationship.isDirty) {
242+
// eslint-disable-next-line no-console
243+
console.log(
244+
`setting relationship to dirty because the remote removal was not in our previous list of local removals`
245+
);
246+
}
241247
}
242248
relationship.isDirty = true;
243249
}

0 commit comments

Comments
 (0)