LearnNewsExamplesServices
Frontmatter
id6635
titlecore.Observable: not removing listeners with "once" properly, for multiple occurences on the same event target
stateClosed
labels
bug
assignees[]
createdAtApr 9, 2025, 12:37 AM
updatedAtApr 9, 2025, 12:38 AM
githubUrlhttps://github.com/neomjs/neo/issues/6635
authortobiu
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtApr 9, 2025, 12:38 AM

core.Observable: not removing listeners with "once" properly, for multiple occurences on the same event target

Closed v8.41.2 bug
tobiu
tobiu commented on Apr 9, 2025, 12:37 AM
  • We are iterating over a shallow copy of the listeners[name] array
  • splice() using the current index works for the first match, but for following iterations, the index is too high

component.Base:

     async render(mount) {
        let me              = this,
            autoMount       = mount || me.autoMount,
            {app}           = me,
            {useVdomWorker} = Neo.config;

        // Verify that the critical rendering path => CSS files for the new tree is in place
        if (autoMount && currentWorker.countLoadingThemeFiles !== 0) {
            currentWorker.on('themeFilesLoaded', function() {
                !me.mounted && me.render(mount)
            }, me, {once: true});

            return
        }

Especially for form field trigger clicks, which show a picker, it can lead to side effects.

tobiu added the bug label on Apr 9, 2025, 12:37 AM
tobiu referenced in commit 5980dfe - "core.Observable: not removing listeners with "once" properly, for multiple occurrences on the same event target #6635" on Apr 9, 2025, 12:37 AM
tobiu closed this issue on Apr 9, 2025, 12:38 AM