Skip to content

Commit

Permalink
singleton record-data only
Browse files Browse the repository at this point in the history
  • Loading branch information
runspired committed Aug 29, 2022
1 parent f8ed916 commit bc7f252
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 720 deletions.
10 changes: 2 additions & 8 deletions packages/-ember-data/tests/integration/records/load-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { reject, resolve } from 'rsvp';
import { setupTest } from 'ember-qunit';

import JSONAPIAdapter from '@ember-data/adapter/json-api';
import { V2CACHE_SINGLETON_RECORD_DATA } from '@ember-data/canary-features';
import Model, { attr, belongsTo } from '@ember-data/model';
import JSONAPISerializer from '@ember-data/serializer/json-api';
import Store from '@ember-data/store';
Expand Down Expand Up @@ -223,13 +222,8 @@ module('integration/load - Loading Records', function (hooks) {

// test that after the reload-due-to-unload our state is correct
newRecordData = cache.peek({ identifier, bucket: 'recordData' });
if (V2CACHE_SINGLETON_RECORD_DATA) {
// this first assertion changes based on activation of singleton cache because its a simple mapping of identifier
// to state and we now have state
assert.false(recordData.isEmpty(identifier), 'after second find: Our original recordData is no longer empty');
} else {
assert.true(recordData.isEmpty(identifier), 'after second find: Our original recordData is still empty');
}
assert.false(recordData.isEmpty(identifier), 'after second find: Our original recordData is no longer empty');

assert.false(newRecordData.isEmpty(identifier), 'after second find: We are no longer empty');
assert.false(_isLoading(cache, identifier), 'after second find: We have loaded');
assert.false(record.isReloading, 'after second find: We are not reloading');
Expand Down
1 change: 0 additions & 1 deletion packages/canary-features/addon/default-features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,5 +171,4 @@
*/
export default {
SAMPLE_FEATURE_FLAG: null,
V2CACHE_SINGLETON_RECORD_DATA: true,
};
1 change: 0 additions & 1 deletion packages/canary-features/addon/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,3 @@ function featureValue(value: boolean | null): boolean | null {

export const FEATURES: FeatureList = Object.assign({}, DEFAULT_FEATURES, ENV.FEATURES);
export const SAMPLE_FEATURE_FLAG = featureValue(FEATURES.SAMPLE_FEATURE_FLAG);
export const V2CACHE_SINGLETON_RECORD_DATA = featureValue(FEATURES.V2CACHE_SINGLETON_RECORD_DATA);
Loading

0 comments on commit bc7f252

Please sign in to comment.