From d7c0e2ecf86ae8dcfc9f18fafbc1516507a3d70d Mon Sep 17 00:00:00 2001 From: Scott Newcomer Date: Wed, 30 Mar 2022 22:14:57 -0500 Subject: [PATCH] feedback --- .../tests/integration/store-test.js | 2 +- .../tests/unit/store/async-leak-test.js | 4 ++-- .../addon/-private/system/fetch-manager.ts | 18 +++++++++--------- .../addon/-private/system/store/common.js | 6 +++--- .../addon/-private/system/store/finders.js | 12 ++++++------ 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/packages/-ember-data/tests/integration/store-test.js b/packages/-ember-data/tests/integration/store-test.js index 29efea5ad05..28c5f7e192e 100644 --- a/packages/-ember-data/tests/integration/store-test.js +++ b/packages/-ember-data/tests/integration/store-test.js @@ -177,7 +177,7 @@ module('integration/store - destroy', function (hooks) { assert.ok(true, 'we made it to the end'); if (DEPRECATE_RSVP_PROMISE) { - assert.expectDeprecation({ id: 'ember-data:rsvp-promise-hanging', count: 1 }); + assert.expectDeprecation({ id: 'ember-data:rsvp-unresolved-async', count: 1 }); } requestPromise.then(() => { diff --git a/packages/-ember-data/tests/unit/store/async-leak-test.js b/packages/-ember-data/tests/unit/store/async-leak-test.js index 0912df7f8ac..9acebcc124c 100644 --- a/packages/-ember-data/tests/unit/store/async-leak-test.js +++ b/packages/-ember-data/tests/unit/store/async-leak-test.js @@ -207,7 +207,7 @@ module('unit/store async-waiter and leak detection', function (hooks) { assert.true(waiter(), 'We return true because the waiter is cleared'); if (DEPRECATE_RSVP_PROMISE) { - assert.expectDeprecation({ id: 'ember-data:rsvp-promise-hanging', count: 1 }); + assert.expectDeprecation({ id: 'ember-data:rsvp-unresolved-async', count: 1 }); } }); @@ -258,7 +258,7 @@ module('unit/store async-waiter and leak detection', function (hooks) { assert.true(waiter(), 'We return true because the waiter is cleared'); if (DEPRECATE_RSVP_PROMISE) { - assert.expectDeprecation({ id: 'ember-data:rsvp-promise-hanging', count: 1 }); + assert.expectDeprecation({ id: 'ember-data:rsvp-unresolved-async', count: 1 }); } }); diff --git a/packages/store/addon/-private/system/fetch-manager.ts b/packages/store/addon/-private/system/fetch-manager.ts index e6b2b3cb783..706c107f713 100644 --- a/packages/store/addon/-private/system/fetch-manager.ts +++ b/packages/store/addon/-private/system/fetch-manager.ts @@ -46,7 +46,7 @@ interface PendingSaveItem { resolver: RSVP.Deferred; snapshot: Snapshot; identifier: RecordIdentifier; - options: { [k: string]: unknown; [SaveOp]: 'createRecord' | 'saveRecord' | 'updateRecord' }; + options: { [k: string]: unknown;[SaveOp]: 'createRecord' | 'saveRecord' | 'updateRecord' }; queryRequest: Request; } @@ -147,12 +147,12 @@ export default class FetchManager { `A Promise while saving ${modelName} did not resolve by the time your model was destroyed. This will error in a future release.`, false, { - id: 'ember-data:rsvp-promise-hanging', + id: 'ember-data:rsvp-unresolved-async', until: '5.0', for: '@ember-data/store', since: { - available: '4.4', - enabled: '4.4', + available: '4.5', + enabled: '4.5', }, } ); @@ -370,8 +370,8 @@ export default class FetchManager { if (missingSnapshots.length) { warn( 'Ember Data expected to find records with the following ids in the adapter response but they were missing: [ "' + - missingSnapshots.map((r) => r.id).join('", "') + - '" ]', + missingSnapshots.map((r) => r.id).join('", "') + + '" ]', false, { id: 'ds.store.missing-records-from-adapter', @@ -393,9 +393,9 @@ export default class FetchManager { if (pair) { pair.resolver.reject( error || - new Error( - `Expected: '<${snapshot.modelName}:${snapshot.id}>' to be present in the adapter provided payload, but it was not found.` - ) + new Error( + `Expected: '<${snapshot.modelName}:${snapshot.id}>' to be present in the adapter provided payload, but it was not found.` + ) ); } } diff --git a/packages/store/addon/-private/system/store/common.js b/packages/store/addon/-private/system/store/common.js index 911e1ef06d4..3162d912e04 100644 --- a/packages/store/addon/-private/system/store/common.js +++ b/packages/store/addon/-private/system/store/common.js @@ -42,12 +42,12 @@ export function guardDestroyedStore(promise, store, label) { `A Promise did not resolve by the time the store was destroyed. This will error in a future release.`, false, { - id: 'ember-data:rsvp-promise-hanging', + id: 'ember-data:rsvp-unresolved-async', until: '5.0', for: '@ember-data/store', since: { - available: '4.4', - enabled: '4.4', + available: '4.5', + enabled: '4.5', }, } ); diff --git a/packages/store/addon/-private/system/store/finders.js b/packages/store/addon/-private/system/store/finders.js index b68eaf32a9f..20138abe103 100644 --- a/packages/store/addon/-private/system/store/finders.js +++ b/packages/store/addon/-private/system/store/finders.js @@ -222,12 +222,12 @@ export function _findHasMany(adapter, store, internalModel, link, relationship, `A Promise for fecthing ${relationship.type} did not resolve by the time your model was destroyed. This will error in a future release.`, false, { - id: 'ember-data:rsvp-promise-hanging', + id: 'ember-data:rsvp-unresolved-async', until: '5.0', for: '@ember-data/store', since: { - available: '4.4', - enabled: '4.4', + available: '4.5', + enabled: '4.5', }, } ); @@ -281,12 +281,12 @@ export function _findBelongsTo(adapter, store, internalModel, link, relationship `A Promise for fetching ${relationship.type} did not resolve by the time your model was destroyed. This will error in a future release.`, false, { - id: 'ember-data:rsvp-promise-hanging', + id: 'ember-data:rsvp-unresolved-async', until: '5.0', for: '@ember-data/store', since: { - available: '4.4', - enabled: '4.4', + available: '4.5', + enabled: '4.5', }, } );