View Issue Details

IDProjectCategoryView StatusLast Update
0021666MMW 5Generalpublic2025-06-28 16:46
Reporterzvezdan Assigned To 
PriorityurgentSeveritycrashReproducibilityN/A
Status assignedResolutionopen 
Target Version2024.2 
Summary0021666: Uncaught Error: "Cannot read properties of undefined (reading 'expand_lock')"
DescriptionI have a script which is doing many SQL updates inside one transaction, all of them are executed using await in a sequence. On its end I have something like this:

    if (app.versionBuild >= 2653) {
        await app.db.clearCache();
    }
    // uitools.refreshView(); // doesn't change anything
    var _window = app.dialogs.getMainWindow()._window;
    var coll = app.collections.getCollection(-1);
    _window.nodeUtils.getNodeByPath(_window.currentTabControl.rootNode, [_window.navUtils.createNodeState('root'), _window.navUtils.createNodeState('collection', coll), _window.navUtils.createNodeState('location', coll)]).then(function (oNode) {
        console.log('getNodeByPath: ', (oNode));
        _window.nodeUtils.refreshNodeChildren(oNode, /* withoutProgress: */ true).then(async function () {
            console.log('refreshNodeChildren: ', (oNode));
            // the rest of code
        });
    });

Steps to reproduce:
- start the program with any node selected, except Entire Library > Location node;
- execute script;
- select any node except Entire Library > Location node -> nothing happens for about 25 seconds, i.e. the selected node will not be highlighted, nor the Navigation bar will be updated;
- select Entire Library > Location node -> error;

If I start the program and select the Location node, then I select any other node and execute the script, the error will not happen.

If I change withoutProgress argument to false, the error will not happen (although, the Tree is not responsive for about 25 seconds anyway).

I resolved this using await for both getNodeByPath and refreshNodeChildren.

Tested with the 3162, 2626 (without clearCache) and several other builds in between, with the same result.
TagsNo tags attached.
Attached Files
Fixed in build

Activities