diff --git a/packages/store/src/-private/caches/identifier-cache.ts b/packages/store/src/-private/caches/identifier-cache.ts index c90dd07b2a1..f0bd5f78f67 100644 --- a/packages/store/src/-private/caches/identifier-cache.ts +++ b/packages/store/src/-private/caches/identifier-cache.ts @@ -445,10 +445,11 @@ export class IdentifierCache { // If the incoming type does not match the identifier type, we need to create an identifier for the incoming // data so we can merge the incoming data with the existing identifier, see #7325 and #7363 if (identifier.type !== keyInfo.type) { - let incomingDataResource = { ...data }; - // Need to strip the lid from the incomingData in order force a new identifier creation - delete incomingDataResource.lid; - existingIdentifier = this.getOrCreateRecordIdentifier(incomingDataResource); + if (hasLid(data)) { + // Strip the lid to ensure we force a new identifier creation + delete data.lid; + } + existingIdentifier = this.getOrCreateRecordIdentifier(data); } }