DELETE request is completing before GET request when trying to findRecord and destroyRecord in ember
<p>I have the following code in ember 2.6; ember-data 2.6.1</p>

<pre><code>import Ember from 'ember';

export default Ember.Route.extend({
    activate() {
        var route = this;
        var sessionId = localStorage.getItem('sessionId');
        if (sessionId) {
            localStorage.removeItem('sessionId');
            this.store.findRecord('session', sessionId).then(function found(session) {
                session.destroyRecord();
                route.transitionTo('index');
            });
        } else {
            this.transitionTo('sessions.new');
        }
    }
});
</code></pre>

<p>I have a logout button that has hbs template code as:</p>

<pre><code>&lt;li&gt;{{#link-to 'sessions.delete'}}{{fa-icon "fa-lock"}} Logout{{/link-to}}&lt;/li&gt;
</code></pre>

<p>The <code>Route.extend</code> code is executed when /sessions/delete is called!</p>

<p>What I observe is the order of REST calls are:</p>

<pre><code>1) ***DELETE*** http://dozee.me:3000/api/sessions/&lt;sessionId&gt;
2) ***GET*** http://dozee.me:3000/api/sessions/&lt;sessionId&gt;
</code></pre>

<p>The second REST request throws and error because by that time the session/cookie is already cleaned up.</p>

<p>What I expect is the order of the REST calls should actually be reverse but I am unable to figure out why is it not like that!</p>

<p>Any pointers &amp; hints will be appreciated ;)</p>