Sitelet https://github.com/allinurl/goaccess/issues/2979
Skip to content

Race condition when loading panels #2979

Description

@h0lley

I've installed GoAccess 1.11 two weeks ago and think it is amazing! However I am now facing a deal-breaking issue:

After accumulating some 1.8 GB of log, the second panel (Requested Files) or a subsequent one takes a moment to load.

Before all panels have been added to the DOM, verifySort is already attempting to grab their references:

verifySort: function() {
    var ui = GoAccess.getPanelUI();
    for (var panel in ui) {
        if (GoAccess.Util.isPanelValid(panel) || GoAccess.Util.isPanelHidden(panel))
            continue;
        var sort = GoAccess.Util.getProp(GoAccess.AppState, panel + '.sort');
        if (JSON.stringify(sort) === JSON.stringify(ui[panel].sort))
            continue;
        this.sortData(panel, sort.field, sort.order);
    }
},

as it is lacking a safety check, it errors:

Uncaught TypeError: Cannot read properties of undefined (reading 'field')
    at Object.verifySort (goaccess/:1:2040494)
    at Object.renderData (goaccess/:1:2041193)
    at Object.<anonymous> (goaccess/:1:1994486)

being an Uncaught TypeError, the thread is interrupted and the GoAcccess GUI never finishes loading.

Or at least that's my assessment. Does that help?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions