Skip to content

InfinityLoader.willDestroy incorrectly assumes inifinityModel is still valid #485

@trevordevore

Description

@trevordevore

After updating to ember-infinity 3.0.0 I'm seeing the following error when transitioning to a new route:

global failure: TypeError: Cannot read properties of undefined (reading 'off')
Source:
TypeError: Cannot read properties of undefined (reading 'off')

The error occurs in addon/components/infinity-loader.js#willDestroy because infinityModel is null. I see that in commit
9b6956b the check for isDestroyed was added because of the same error after a route change.

The difference in my situation is that isDestroyed is false BUT isDestroying is true. In my case the infinityModel has already been nullified at this point.

Context

The application is running Ember 3.28 and is being prepared for an upgraded to 4. I tested the same code with Ember 4.0.1 but got the same result.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions