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

add refresh method to models #54

Closed
wants to merge 4 commits into from
Closed

add refresh method to models #54

wants to merge 4 commits into from

Conversation

tchak
Copy link
Member

@tchak tchak commented Jan 18, 2012

fix #51

next step : refresh method on ModelArray

@tchak
Copy link
Member Author

tchak commented Jan 19, 2012

I am not sure it make sens to have refresh on a generic ModelArray, feedback from @tomdale or @wycats is more then welcome

@wycats
Copy link
Member

wycats commented Jan 19, 2012

Agreed. What is the use-case for this feature?

@tchak
Copy link
Member Author

tchak commented Jan 19, 2012

The most useful is to refresh findQuery results

For example a searchController could be implemented as

App.searchController = Em.ArrayProxy.create({
  content: App.store.findQuery(App.Item, {q:''}),

  search: function(text) {
    var content = this.get('content');
    content.set('query', {q: text});
    content.refresh();
  }
})

@tomdale
Copy link
Member

tomdale commented Jan 25, 2012

👎 from me on this in its current state.

My reservations:

  1. This does not seem like the correct solution to Refreshing partially loaded records #51. In the scenario described there, we have models that are partially loaded during queries. I'd consider it a hack that you have to refresh the model to finish populating the record. I would be very confused reading code that calls refresh() on a record in order to load extended details--I'd think that we would be refreshing it to get the latest value. Partially-loaded records are common and I think we need the right concepts to handle them.
  2. While refreshing a model is important, I don't think this implementation has thought through all of the possible cases. It basically just blindly resets the record and starts loading again. For example, right now if I call refresh() on a model that has been updated but not yet saved, those changes will be lost and the model will eventually return to the loaded state.
  3. The callAdapter() refactor is very confusing to me. Reading through the code, I see callAdapter() often but it is hard to reason about what it is actually doing, since "call adapter" is very vague. I'm on board with the refactor since it DRYs up the code but I think you should consider renaming this something like findFromAdapter or something else that makes its behavior explicit.

@tchak
Copy link
Member Author

tchak commented Jan 26, 2012

I agree about partial loading.

What about refresh on AdapterPopulatedModelArray ? If I remove for now refresh on model and fix findFromAdapter would it be ok for you?

@tchak
Copy link
Member Author

tchak commented Feb 26, 2012

closing for now
Need full rewrite against master and need to take in to account possible overload of dirty records

@tchak tchak closed this Feb 26, 2012
iamdtang referenced this pull request in iamdtang/data Nov 6, 2019
# This is the 1st commit message:

WIP Tracerbench Travis setup

# This is the commit message #2:

dont checkin results

# This is the commit message #3:

configure azure job, make first thing for testing

# This is the commit message #4:

config updates

# This is the commit message #5:

Able to get results from Tracerbench

# This is the commit message #6:

redirect for tracerbench

# This is the commit message #7:

Update URLs to include ?tracerbench=true

# This is the commit message #8:

wip

# This is the commit message #9:

moves .server-replay.json to root

# This is the commit message #10:

wip

# This is the commit message #11:

cleanup

# This is the commit message #12:

cleanup

# This is the commit message #13:

cleanup

# This is the commit message #14:

cleanup

# This is the commit message #15:

change command

# This is the commit message #16:

Make process terminate with exit code 0

# This is the commit message #17:

Ignore tracerbench-results files

# This is the commit message #18:

Delete generated JSON file

# This is the commit message #19:

rename directory

# This is the commit message #20:

Bump ember-decorators-polyfill from 1.0.6 to 1.1.0

Bumps [ember-decorators-polyfill](https://github.com/pzuraq/ember-decorators-polyfill) from 1.0.6 to 1.1.0.
- [Release notes](https://github.com/pzuraq/ember-decorators-polyfill/releases)
- [Commits](ember-polyfills/ember-decorators-polyfill@1.0.6...1.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
# This is the commit message #21:

Bump @ember/optional-features from 1.0.0 to 1.1.0

Bumps [@ember/optional-features](https://github.com/emberjs/ember-optional-features) from 1.0.0 to 1.1.0.
- [Release notes](https://github.com/emberjs/ember-optional-features/releases)
- [Changelog](https://github.com/emberjs/ember-optional-features/blob/master/CHANGELOG.md)
- [Commits](emberjs/ember-optional-features@v1.0.0...v1.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
# This is the commit message #22:

[CHORE] fix Typo (emberjs#6635)

Happen to run into this typo. Been using Ember for years, love your work! Good luck!

Co-authored-by: igorT <terzicigor@gmail.com>
# This is the commit message #23:

Update Changelog for v3.13.0

# This is the commit message #24:

update changelog for v3.13.1

# This is the commit message #25:

[CHORE] adds infra for testing calls to Ember warn|deprecate|assert (emberjs#6626)

* [CHORE] adds infra for testing calls to Ember warn|deprecate|assert

* fix production tests

* address feedback

* feedback on labels

* remove id checks

# This is the commit message #26:

[CHORE] Refactor integration/multiple-stores-test.js in order to remove run loop usage (emberjs#6632)


# This is the commit message #27:

Bump ember-simple-tree from 0.7.0 to 0.7.1

Bumps [ember-simple-tree](https://github.com/btecu/ember-simple-tree) from 0.7.0 to 0.7.1.
- [Release notes](https://github.com/btecu/ember-simple-tree/releases)
- [Commits](btecu/ember-simple-tree@0.7.0...0.7.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
# This is the commit message #28:

Bump ember-decorators-polyfill from 1.1.0 to 1.1.1

Bumps [ember-decorators-polyfill](https://github.com/pzuraq/ember-decorators-polyfill) from 1.1.0 to 1.1.1.
- [Release notes](https://github.com/pzuraq/ember-decorators-polyfill/releases)
- [Commits](ember-polyfills/ember-decorators-polyfill@1.1.0...1.1.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
# This is the commit message #29:

cleanup serializer documentation (emberjs#6575)


# This is the commit message #30:

ISSUE-6012: test: added test for meta property and bug fix. (emberjs#6640)


# This is the commit message #31:

[FEAT links] ensures full links object support for relationships (emberjs#6606)

* [FEAT links] ensures full links object support for relationships

* fix lint

* add feature flags

# This is the commit message #32:

[BUGFIX release] Enable `store.createRecord` in FastBoot (emberjs#6568)

* Add FastBoot test for store.createRecord

Fails at the moment.

* Enable store.createRecord in FastBoot

Changes the V4 UUID generation to leverage `FastBoot.require` when
possible. This currently requires that the host application add the
following to their `package.json`:

```
"fastbootDependencies": [
  "crypto"
]
```

* fix types

# This is the commit message #33:

[CHORE] rename and restructure packages to clarify unpublished/private status

move unpublished packages into directories marked private

move published but private into better naming convention

move unpublished into better naming convention

change -build-infra imports to private-build-infra

larger re-org

# This is the commit message #34:

Bump eslint-config-prettier from 6.4.0 to 6.5.0

Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 6.4.0 to 6.5.0.
- [Release notes](https://github.com/prettier/eslint-config-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-config-prettier/blob/master/CHANGELOG.md)
- [Commits](prettier/eslint-config-prettier@v6.4.0...v6.5.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
# This is the commit message #35:

Bump eslint from 6.5.1 to 6.6.0

Bumps [eslint](https://github.com/eslint/eslint) from 6.5.1 to 6.6.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](eslint/eslint@v6.5.1...v6.6.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
# This is the commit message #36:

[CHORE] refactor: Remove runloop usage in destroy module of integration/store… (emberjs#6646)

* refactor: Remove runloop usage in destroy module of integration/store-test

* fix linter errors

# This is the commit message #37:

Bump @types/ember__debug from 3.0.5 to 3.0.6 (emberjs#6647)

Bumps [@types/ember__debug](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ember__debug) from 3.0.5 to 3.0.6.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ember__debug)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
# This is the commit message #38:

Bump eslint-plugin-mocha from 6.2.0 to 6.2.1

Bumps [eslint-plugin-mocha](https://github.com/lo1tuma/eslint-plugin-mocha) from 6.2.0 to 6.2.1.
- [Release notes](https://github.com/lo1tuma/eslint-plugin-mocha/releases)
- [Changelog](https://github.com/lo1tuma/eslint-plugin-mocha/blob/master/CHANGELOG.md)
- [Commits](lo1tuma/eslint-plugin-mocha@6.2.0...6.2.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
# This is the commit message #39:

Bump qunit-dom from 0.9.0 to 0.9.1

Bumps [qunit-dom](https://github.com/simplabs/qunit-dom) from 0.9.0 to 0.9.1.
- [Release notes](https://github.com/simplabs/qunit-dom/releases)
- [Changelog](https://github.com/simplabs/qunit-dom/blob/master/CHANGELOG.md)
- [Commits](mainmatter/qunit-dom@v0.9.0...v0.9.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
# This is the commit message #40:

Bump @typescript-eslint/parser from 2.5.0 to 2.6.0

Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 2.5.0 to 2.6.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v2.6.0/packages/parser)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
# This is the commit message #41:

Bump @typescript-eslint/eslint-plugin from 2.5.0 to 2.6.0

Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 2.5.0 to 2.6.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v2.6.0/packages/eslint-plugin)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
# This is the commit message #42:

fix tracerbench command for renamed test app folder

# This is the commit message #43:

Setup har-remix

# This is the commit message #44:

replace server-replay with har-remix

# This is the commit message #45:

Use concurrently from node_modules instead of global installation

# This is the commit message #46:

wip

# This is the commit message #47:

Update bash script to use ember-data workspace for experiment

# This is the commit message #48:

relationship performance bash script updates

# This is the commit message #49:

removes line breaks

# This is the commit message #50:

removes .travis.yml from test app

# This is the commit message #51:

cleanup linting

# This is the commit message #52:

change eslint config

# This is the commit message #53:

cleanup

# This is the commit message #54:

remove comments

# This is the commit message #55:

updates azure-pipelines.yml

# This is the commit message #56:

adds tracerbench to github action workflow

# This is the commit message #57:

Update CI to install PM2 globally

# This is the commit message #58:

[CHORE] allow asserting all tests for deprecations (emberjs#6627)

* [CHORE] configure the ability to filter deprecations from assertNoDeprecations

* turn off helpers until tests are fixed

# This is the commit message #59:

[DOC] Close code block in the description
# This is the commit message #60:

Bump ember-qunit from 4.5.1 to 4.6.0

Bumps [ember-qunit](https://github.com/emberjs/ember-qunit) from 4.5.1 to 4.6.0.
- [Release notes](https://github.com/emberjs/ember-qunit/releases)
- [Changelog](https://github.com/emberjs/ember-qunit/blob/master/CHANGELOG.md)
- [Commits](emberjs/ember-qunit@v4.5.1...v4.6.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
# This is the commit message #61:

Bump ember-fetch from 6.7.1 to 6.7.2

Bumps [ember-fetch](https://github.com/ember-cli/ember-fetch) from 6.7.1 to 6.7.2.
- [Release notes](https://github.com/ember-cli/ember-fetch/releases)
- [Changelog](https://github.com/ember-cli/ember-fetch/blob/v6.7.2/CHANGELOG.md)
- [Commits](ember-cli/ember-fetch@v6.7.1...v6.7.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
# This is the commit message #62:

Bump ember-load-initializers from 2.1.0 to 2.1.1

Bumps [ember-load-initializers](https://github.com/ember-cli/ember-load-initializers) from 2.1.0 to 2.1.1.
- [Release notes](https://github.com/ember-cli/ember-load-initializers/releases)
- [Changelog](https://github.com/ember-cli/ember-load-initializers/blob/master/CHANGELOG.md)
- [Commits](ember-cli/ember-load-initializers@v2.1.0...v2.1.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
# This is the commit message #63:

Bump ember-source from 3.13.3 to 3.14.1

Bumps [ember-source](https://github.com/emberjs/ember.js) from 3.13.3 to 3.14.1.
- [Release notes](https://github.com/emberjs/ember.js/releases)
- [Changelog](https://github.com/emberjs/ember.js/blob/master/CHANGELOG.md)
- [Commits](emberjs/ember.js@v3.13.3...v3.14.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
# This is the commit message #64:

Bump eslint-plugin-ember from 7.2.0 to 7.3.0

Bumps [eslint-plugin-ember](https://github.com/ember-cli/eslint-plugin-ember) from 7.2.0 to 7.3.0.
- [Release notes](https://github.com/ember-cli/eslint-plugin-ember/releases)
- [Changelog](https://github.com/ember-cli/eslint-plugin-ember/blob/master/CHANGELOG.md)
- [Commits](ember-cli/eslint-plugin-ember@v7.2.0...v7.3.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refreshing partially loaded records
3 participants