Skip to content

acode.waitForPlugin shouldn't return undefined #2938

Open

Description

@blanhhy

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

In the current implementation, after waiting for the target plugin to finish loading, resolve() is called instead of resolve(true):

Acode/src/lib/acode.js

Lines 702 to 707 in b7dbe3d

[onPluginLoadCallback](pluginId) {
if (this.#pluginWatchers[pluginId]) {
this.#pluginWatchers[pluginId].resolve();
delete this.#pluginWatchers[pluginId];
}
}

which contradicts the documentation’s description that it returns a Promise<boolean>:

Image

Environment

not matter

If applicable, add mockups / screenshots regarding your vision

No response

If applicable, attach your Acode.log file to this issue.

Acode.log

Activity

  1. added theissue type on Sep 25, 2026
  2. added
    bugSomething isn't working
    plugin apiIt represents, plugins specific apis enhancement
    on Nov 12, 2026
  3. pwnprakashgh commented on Nov 13, 2026

    @pwnprakashgh

    Hi maintainers!

    I’ve prepared a focused fix for this issue in my fork.

    The change makes waitForPlugin() consistently resolve to true after a pending plugin finishes loading. I’ve also added regression tests covering successful loading, already-loaded plugins, and failed loading.

    My branch: https://github.com/pwnprakashgh/acode/tree/fix/wait-for-plugin-resolves-true-2938

    I noticed that PR #2955 also modifies this callback as part of a broader improvement.

    Would a separate, smaller PR for #2938 be useful, or would you prefer that I hold off to avoid duplicating work?

    I’m new to contributing to this project and happy to follow your guidance. Thanks!

  4. bajrangCoder commented on Nov 13, 2026

    @bajrangCoder
    Member

    @pwnprakashgh Sure, open a PR. The fix is fine, but the test is weak (it slices acode.js by exact text, so any refactor breaks it). Also run pnpm check, the formatting is off (the repo uses tabs).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingplugin apiIt represents, plugins specific apis enhancement

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions