0.0.1 • Published 3 years ago

ember-data-stop-infinite-retry-for-failed-relationship-fetches v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

ember-data-stop-infinite-retry-for-failed-relationship-fetches

This addon is a workaround to unblock Ember upgrade during existed bug in ember-data (from 3.1.2 to 3.12):

"infinite retry bug for failed relationship fetches"

we're actually experiencing this issue with v3.1.2 (which we upgraded to for the fix for #4963). We're aiming to upgrade rapidly soon, but have a few blocking factors that we have to tackle first.

(https://github.com/emberjs/data/pull/6112#issuecomment-519675040)

related to:

Installation

ember install ember-data-stop-infinite-retry-for-failed-relationship-fetches

Usage

Change app/adapters/application.js:

import { inject as service } from '@ember/service';
// ...
export default ActiveModelAdapter.extend({
  cacheResponse: service(),

  handleResponse(status, headers, payload, requestData) {
    // ...
    if (status !== 200) {
      this.get('cacheResponse').handle([status, payload, requestData]);
    }

    return this._super(status, headers, payload, requestData);
  },
  // ...
});

Contributing

Installation

  • git clone git@github.com:Mifrill/ember-data-stop-infinite-retry-for-failed-relationship-fetches.git
  • cd ember-data-stop-infinite-retry-for-failed-relationship-fetches
  • npm install

Linting

  • yarn lint:js
  • yarn lint:js -- --fix

Running tests

  • ember test – Runs the test suite on the current Ember version
  • ember test --server – Runs the test suite in "watch mode"
  • ember try:each – Runs the test suite against multiple Ember versions

Running the dummy application

For more information on using ember-cli, visit https://ember-cli.com/.

License

This project is licensed under the MIT License.