Skip to content

Calling move methods immediately after deactivating cover causes deactivation to fail #256

@oscarlorentzon

Description

@oscarlorentzon

mapillary-js version: 2.7.0

Steps to Reproduce Behavior

  1. Create a viewer instance and deactivate the cover
  2. Call moveToKey before the node for the key specified in the viewer constructor has been retrieved.
var viewer = new Mapillary.Viewer(
    "<container-id>",
    "<client-id>",
    "<any-key>",
    {
        component: {
            cover: false,
        },
    });

viewer.moveToKey("<any-key>");

Expected Behavior

Deactivation continues whereas moveToKey throws an exception in the promise with a error message stating that it is not possible to navigate by calling any Viewer.move* method while the cover has an image and is active or is in the process of deactivating.

Actual Behavior

The moveToKey call aborts the deactivation causing it to fail so that the cover is still active and shown.

Additional information

This was introduced with the fix of #26 in 2.7.0. The behavior of previous versions where it was possible to call moveToKey resulted in a race condition regarding setting the current node and was faulty.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions