Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove dead sinceToken code #6163

Merged
merged 1 commit into from
Jun 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions packages/store/addon/-private/system/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -1970,7 +1970,6 @@ const Store = Service.extend({
*/
_fetchAll(modelName, array, options = {}) {
let adapter = this.adapterFor(modelName);
let sinceToken = this._internalModelsFor(modelName).metadata.since;

assert(`You tried to load all records but you have no adapter (for ${modelName})`, adapter);
assert(
Expand All @@ -1980,14 +1979,14 @@ const Store = Service.extend({

if (options.reload) {
set(array, 'isUpdating', true);
return promiseArray(_findAll(adapter, this, modelName, sinceToken, options));
return promiseArray(_findAll(adapter, this, modelName, options));
}

let snapshotArray = array._createSnapshot(options);

if (adapter.shouldReloadAll(this, snapshotArray)) {
set(array, 'isUpdating', true);
return promiseArray(_findAll(adapter, this, modelName, sinceToken, options));
return promiseArray(_findAll(adapter, this, modelName, options));
}

if (options.backgroundReload === false) {
Expand All @@ -1996,7 +1995,7 @@ const Store = Service.extend({

if (options.backgroundReload || adapter.shouldBackgroundReloadAll(this, snapshotArray)) {
set(array, 'isUpdating', true);
_findAll(adapter, this, modelName, sinceToken, options);
_findAll(adapter, this, modelName, options);
}

return promiseArray(Promise.resolve(array));
Expand Down
4 changes: 2 additions & 2 deletions packages/store/addon/-private/system/store/finders.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,12 +366,12 @@ export function _findBelongsTo(adapter, store, internalModel, link, relationship
);
}

export function _findAll(adapter, store, modelName, sinceToken, options) {
export function _findAll(adapter, store, modelName, options) {
let modelClass = store.modelFor(modelName); // adapter.findAll depends on the class
let recordArray = store.peekAll(modelName);
let snapshotArray = recordArray._createSnapshot(options);
let promise = Promise.resolve().then(() =>
adapter.findAll(store, modelClass, sinceToken, snapshotArray)
adapter.findAll(store, modelClass, null, snapshotArray)
);
let label = 'DS: Handle Adapter#findAll of ' + modelClass;

Expand Down