Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with void-obj of Test Thing #1289

Open
egekorkan opened this issue May 25, 2024 · 1 comment
Open

Issue with void-obj of Test Thing #1289

egekorkan opened this issue May 25, 2024 · 1 comment
Labels
binding-http Issues related to http protocol binding core Issues with the core library need-investigation

Comments

@egekorkan
Copy link
Member

I have noticed a weird behavior with test thing. I have taken the td at http://plugfest.thingweb.io:8083/testthing and generated the flow. Everything but the following actions work: int-void, int-int, int-string. For those ones, I get nothing displayed on the UI but the flow editor shows internal server error. Sending the same request on postman, for example for int-int with input 12 returns 13. Action void-obj does exactly what I expect.

The error is Error: Server error: Internal Server Error

Originally posted by @egekorkan in eclipse-thingweb/node-red#25 (comment)

@relu91 relu91 added binding-http Issues related to http protocol binding need-investigation core Issues with the core library labels May 26, 2024
@danielpeintner
Copy link
Member

danielpeintner commented May 29, 2024

Mhh, can it be that there is no input given?

I tested the following simple script with 3 simple invokeAction calls.

WoT.requestThingDescription("http://plugfest.thingweb.io:8083/testthing")
    .then(async (td) => {
        try {
            const thing = await WoT.consume(td);
            // console.info("=== TD ===");
            // console.info(td);
            // console.info("==========");
            // console.info();
			
			// int-void
			{
				const res = await thing.invokeAction("int-void", 123);
				const value = await res.value();
				console.info("RESPONSE for int-void: ", value);				
			}
			// int-int
			{
				const res = await thing.invokeAction("int-int", 453);
				const value = await res.value();
				console.info("RESPONSE for int-int: ", value);				
			}
			
			// this is failing because there is no input as expected 
			// int-void (with no input)
			{
				const res = await thing.invokeAction("int-void"); // , 123);
				const value = await res.value();
				console.info("RESPONSE for int-void: ", value);				
			}
			
        } catch (err) {
            console.error("Script error:", err);
        }
    })
    .catch((err) => {
        console.error("Fetch error:", err);
    });

The console log is as follows.

node packages\cli\dist\cli.js --client-only examples\testthing\testclient2.js
RESPONSE for int-void:  undefined
RESPONSE for int-int:  454
Script error: Error: Server error: Internal Server Error

As long as I pass the input value to the invokeAction call everything is fine. Once I don't do that I get the same error...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
binding-http Issues related to http protocol binding core Issues with the core library need-investigation
Projects
None yet
Development

No branches or pull requests

3 participants