flomesh-io / pipy

Pipy is a programmable proxy for the cloud, edge and IoT.
https://flomesh.io/pipy
Other
743 stars 70 forks source link

Accessing Existing/Non-Existing variables in onEnd not working #113

Closed naqvis closed 1 year ago

naqvis commented 1 year ago

Pipy version

Using the latest commit

Version     : 0.50.0-18
Commit      : b80b1bc464f95b3ad6c2f2b38c2e7c0acc065877
Commit Date : Thu, 25 Aug 2022 11:47:51 +0800
Host        : Darwin-21.6.0 arm64
OpenSSL     : OpenSSL 1.1.1q  5 Jul 2022
Builtin GUI : Yes
Samples     : Yes

Bug Report

Problem 1

For example trying to access any valid variable doesn't yield any outcome.

 .onEnd(
  () => console.log('print some global variable', __inbound.remoteAddress)
)

Won't print anything, but logging any string literal works.

Problem 2

For example trying to access any invalid or non-existing variable doesn't yield any error/warning.

 .onEnd(
  () => console.log('print some non existing variable', _not_existing_variable)
)

No error/warning is generated.

pajama-coder commented 1 year ago

This bug is solved in a9474a551866a89388420f99a144316301236309. Please verify it @naqvis Thanks.

naqvis commented 1 year ago

This bug is solved in a9474a5. Please verify it @naqvis Thanks.

Thank you @pajama-coder. I verified the latest commit and its fixed. So closing this issue.