From c8fc274628e1c79b6bacc897daf4f617f8ff0f50 Mon Sep 17 00:00:00 2001 From: Chris Thoburn Date: Thu, 11 Aug 2022 09:58:17 -0700 Subject: [PATCH] explore stricter --- .../addon/-private/graph/operations/update-relationship.ts | 2 ++ packages/store/addon/-private/caches/instance-cache.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/packages/record-data/addon/-private/graph/operations/update-relationship.ts b/packages/record-data/addon/-private/graph/operations/update-relationship.ts index 28f9880eedf..f61444e1395 100644 --- a/packages/record-data/addon/-private/graph/operations/update-relationship.ts +++ b/packages/record-data/addon/-private/graph/operations/update-relationship.ts @@ -35,6 +35,7 @@ export default function updateRelationshipOperation(graph: Graph, op: UpdateRela payload.data = []; } assert(`Expected an array`, Array.isArray(payload.data)); + // TODO may not need to cast to stable identifiers here since update likely does this too graph.update( { op: 'replaceRelatedRecords', @@ -45,6 +46,7 @@ export default function updateRelationshipOperation(graph: Graph, op: UpdateRela true ); } else { + // TODO may not need to cast to stable identifiers here since update likely does this too graph.update( { op: 'replaceRelatedRecord', diff --git a/packages/store/addon/-private/caches/instance-cache.ts b/packages/store/addon/-private/caches/instance-cache.ts index 56e1ddfce31..af5ae515764 100644 --- a/packages/store/addon/-private/caches/instance-cache.ts +++ b/packages/store/addon/-private/caches/instance-cache.ts @@ -166,6 +166,7 @@ export class InstanceCache { this._storeWrapper = new RecordDataStoreWrapper(this.store); this.__recordDataFor = (resource: RecordIdentifier) => { + // TODO enforce strict const identifier = this.store.identifierCache.getOrCreateRecordIdentifier(resource); return this.getRecordData(identifier); };