Skip to content

fix: Remove await from listener.forward() on NgrokProxy class#18

Merged
odanado merged 1 commit into
line:mainfrom
zenizh:remove-await-from-forward
May 28, 2025
Merged

fix: Remove await from listener.forward() on NgrokProxy class#18
odanado merged 1 commit into
line:mainfrom
zenizh:remove-await-from-forward

Conversation

@zenizh

@zenizh zenizh commented May 27, 2025

Copy link
Copy Markdown
Member

To prevent subsequent processing from stopping, I removed await from the call to listener.forward() in the NgrokProxy class.

Reason

listener.forward() returns a Promise, but this Promise does not seem to resolve until the forwarding task is complete. Therefore, using await causes subsequent processing to stop, and the CLI no longer works properly.

In fact, when the following command was executed in the current main branch, nothing was output to the terminal:

$ liff-cli serve \
  --liff-id 1234567890-AbcdEfgh \
  --url http://localhost:5173 \
  --proxy-type ngrok

(no output)

Internally, the endpoint was created on Ngrok, but the endpoint URL on the LINE Developers Console was not updated.

In the official documentation sample, listener.forward() is also called without await:

async function create_listener() {
  const session = await new ngrok.NgrokSessionBuilder().authtokenFromEnv().connect();
  const listener = await session.httpEndpoint().listen();
  console.log("Ingress established at:", listener.url());
  listener.forward("localhost:8081");
}

https://github.com/ngrok/ngrok-javascript?tab=readme-ov-file#builders

After removing await, ngrok processed normally, and the endpoint URL on the LINE Developers Console was also updated.

@zenizh zenizh requested a review from a team as a code owner May 27, 2025 14:25
@CLAassistant

CLAassistant commented May 27, 2025

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@zenizh zenizh changed the title Remove await from listener.forward() on NgrokProxy class fix: Remove await from listener.forward() on NgrokProxy class May 27, 2025

@odanado odanado left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Thank you!

@odanado odanado merged commit 4256081 into line:main May 28, 2025
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants