rendrjs / rendr

Render your Backbone.js apps on the client and the server, using Node.js.
MIT License
4.09k stars 313 forks source link

setting writeToCache: false still writes models to cache #510

Open jaredrada opened 8 years ago

jaredrada commented 8 years ago

Believe I found a bug related to optionally storing models in the modelStore.

this.app.fetcher.fetch(
        {
            user: {model: 'Account',}
        },
        {
            'readFromCache': false,
            'writeToCache': false //handle this manually in the success method (handleLoginResponse)
        },
        this.handleLoginResponse.bind(this)
    );

If we set a breakpoint in this.handleLoginResponse we will find that this.app.fetcher.modelStore.cache has an entry for the Account model. If you check shared/fetcher.js we see the option to skip the write to cache is respected. However if we look at line shared/base/model.js in the model is still written to the store.

saponifi3d commented 8 years ago

Thanks for the bug report, thanks for giving loads of details and links into the code itself.