GithubHelp home page GithubHelp logo

mifrill / ember-data-stop-infinite-retry-for-failed-relationship-fetches Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 439 KB

Workaround to avoid bug in ember-data: infinite retry for failed relationship fetches

Home Page: https://github.com/emberjs/data/pull/6112

License: MIT License

JavaScript 88.51% HTML 10.58% Handlebars 0.91%

ember-data-stop-infinite-retry-for-failed-relationship-fetches's Introduction

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.

(emberjs/data#6112 (comment))

related to:

Installation

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

Usage

Change app/adapters/application.js:

import DS from 'ember-data';
import { inject as service } from '@ember/service';

export default DS.JSONAPIAdapter.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);
  },
  // ...
});

compatible with https://github.com/adopted-ember-addons/active-model-adapter

Contributing

Installation

  • git clone [email protected]: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.

ember-data-stop-infinite-retry-for-failed-relationship-fetches's People

Contributors

mifrill avatar ember-tomster avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.