Forge async API event - queue is not progressing and resolver is never reach

Hi @here,

I have followed the documentation to define a consumer for Forge Async Events: https://developer.atlassian.com/platform/forge/runtime-reference/async-events-api/

I am using latest version of dependencies

"@forge/events": "^0.7.0",
"@forge/resolver": "^1.4.4",

When I execute it from UI from AdminPage it seems it’s stuck forever. It’s registered but always inProgress. I don’t get logs from resolver either.

I am able to view status of the job or cancel it, but never progress even after long time of waiting

Sample response from getStats

queue-name#d58d4ebf-2c92-4a9d-870f-5f25903e45cd { inProgress: 1, success: 0, failed: 0 }

Code for execution

const executeAllAsync = async () => {
    try {
      const jobId = await queue.push("payload");
      setJobId(jobId);
    } catch (err) {
      console.error(err);
    }
    console.log("execution async requested")
  }

consumer.ts

import Resolver from "@forge/resolver";

const resolver = new Resolver();

resolver.define("event-listener", async ({ payload }) => {
    console.log("Event received with payload: ", payload);
    return true;
});

export const handler = resolver.getDefinitions();

Configuration is exactly the same as in tutorial.

Issue resolved. After applying changes it was required to kill forge tunnel and do manually

forge deploy
forge install

Afterwards queue started working correctly.

Thanks for replying with the solution you found.

@MaciejJezierski the solution you suggested works. Thanks for posting the solution.

@rwhitbeck I just spent a day going in circles until I found this. Can the docs at https://developer.atlassian.com/platform/forge/runtime-reference/async-events-api/ please be updated to explicitly state that this requires a manual deploy and install?

Just ran into this issue myself and spent forever trying to debug. This really needs to be documented please.