Error report for execution and query intent in the test suite of the google action - deployment

Our project passed “Turn on” execution and query in the test
suite of the google action.
But “Turn off” execution and query failed and I couldn’t find in our part.
After “Turn off” execution, I responded “false” for “on” attribute but
error report was shown - actual state: {"on":true,"online":true}.
Below is the exchanged data and the error report.
Google action request for execution:
{"inputs":[{"context":{"locale_country":"US","locale_language":"en"},"intent":"action.devices.EXECUTE","payload":{"commands":[{"devices":[{"id":"eg_cam_87901"}],"execution":[{"command":"action.devices.commands.OnOff","params":{"on":false}}]}]}}],"requestId":"960820806239759768"}
Our Response for execution:
{"requestId":"960820806239759768","payload":{"commands":[{"ids":["eg_cam_87901"],"status":"SUCCESS","state":{"online":false,"on":false,"currentToggleSettings":null}}]}}
Google action error report
Turn off the bedroom
AssertionError: Expected state to include: {"on":false}, actual state: {"on":true,"online":true}: expected false to be true
Google action request for query:
{"inputs":[{"intent":"action.devices.QUERY","payload":{"devices":[{"id":"eg_cam_87901"}]}}],"requestId":"4409204964431192716"}
Our Response for query:
{"requestId":"4409204964431192716","payload":{"devices":{"eg_cam_87901":{"online":false,"status":"SUCCESS","on":false,"currentToggleSettings":null}}}}
Google action error report
Query after 'Turn off the bedroom'
Error: the string "Error from HA: deviceOffline" was thrown, throw an Error :) at new f (js/app_compiled.js?f77b3b67-f1c5-4a38-8a20-fe5eafbc2c40:18143:10) at Runner.fail (js/app_compiled.js?f77b3b67-f1c5-4a38-8a20-fe5eafbc2c40:4491:11) at js/app_compiled.js?f77b3b67-f1c5-4a38-8a20-fe5eafbc2c40:4802:18 at done (js/app_compiled.js?f77b3b67-f1c5-4a38-8a20-fe5eafbc2c40:4189:5) at js/app_compiled.js?f77b3b67-f1c5-4a38-8a20-fe5eafbc2c40:4236:11 at w.Ic (js/app_compiled.js?f77b3b67-f1c5-4a38-8a20-fe5eafbc2c40:18137:24) at r.run (js/app_compiled.js?f77b3b67-f1c5-4a38-8a20-fe5eafbc2c40:18129:169) at js/app_compiled.js?f77b3b67-f1c5-4a38-8a20-fe5eafbc2c40:18171:310 at w.Jl (js/app_compiled.js?f77b3b67-f1c5-4a38-8a20-fe5eafbc2c40:18137:454) at r.Ms (js/app_compiled.js?f77b3b67-f1c5-4a38-8a20-fe5eafbc2c40:18130:301) at h (js/app_compiled.js?f77b3b67-f1c5-4a38-8a20-fe5eafbc2c40:18126:375) at y.Jl [as Ic] (js/app_compiled.js?f77b3b67-f1c5-4a38-8a20-fe5eafbc2c40:18139:326) at q (js/app_compiled.js?f77b3b67-f1c5-4a38-8a20-fe5eafbc2c40:18167:89) at e (js/app_compiled.js?f77b3b67-f1c5-4a38-8a20-fe5eafbc2c40:18158:235) at XMLHttpRequest.w (js/app_compiled.js?f77b3b67-f1c5-4a38-8a20-fe5eafbc2c40:18167:241)

You've got a couple issues here.
First, you need to verify that your sync response includes the appropriate device attributes - your execution/query responses both return NULL for your currentToggleSettings instead of the string of the availableToggles in your sync response. If you are just using OnOff for your device, you don't actually even need to implement any of the Toggle trait features. Again, verify what is in your initial sync response.
Second, you're returning online: false as well as on:false, which is why you're getting the following error:
Error: the string "Error from HA: deviceOffline" was thrown
online:false should only be used when you intend to return the TTS response of "the device is not available right now" when a user issues a command/query, and when the device cannot be controlled. This should also include status:ERRROR in your response. You can read more about handling errors and exceptions in the docs.
Returning online:true, on:false or online:true, on:true when responding to an execute/query request should fix the deviceOffline error.

Related

Verifiable Credential - Presentation request gives an Internal Server Error

Microsoft Entra, a new Home of Microsoft Verifiable Credential is really new and nice feature. While I am playing around the items, I found an issue which I am not sure is an issue from my code rather Its more from the platform.
To give you little detail:
Company A: I have one Microsoft Verifiable Account to create the credentials for Company A employee.
Company B: I have one Microsoft Verifiable Account to verify (who likes to give a discount to those employees who are from Company A).
Step 1: using Company A, I have created the Verifiable Credential and It is stored in my Microsoft Authenticator App successfully.
Step 2: Coming to the next part of the story, Company B generates the presentation request where It likes to verify Company A employees' identity. I am able to create that presentation request and QR code for that as well.
Issue comes: Now, when I scan that presentation QR code using the authenticator app, It finds my stored crednetial is matching with this request. so, It gives me an option to share that credential against this presentation reuqest which is good and correct. But the moment I press "Share" it wait for a second and gives me an error message.
The error message is user friendly: Oops, failed to connect.
It seems there is a problem with one of our services connecting to your device. Check your network connection and try again.
But in technical detail, It says:
Error Code: internalServerError
Error Details: A generic error has occurred on the server.; Not Found; Not Found
TimeStamp: Dec1, 2022 10:02:48 AM EST
Request ID: 438395be97f20bbcc31511351121bbaa
Correlation ID: 3sg46/0ARha0zS/XHYKGfA.6.4
It also gives an option to see the track which is way long and can not be copy in mobile clipboard. But I took a part of that and that is below:
2022-11-30 17:49:33,560 INFO/Broker: [com.microsoft.identity.common.internal.result.MsalBrokerResultAdapter:authenticationResultFromBundle][2022-11-30 17:49:33 - thread_name: pool-27-thread-2, correlation_id: b27725eb-c6fc-4a0f-bdd5-dd5f3f74270b - Android 30] Broker Result returned from Bundle, constructing authentication result ThreadPoolExecutor$Worker.run()#641 [pool-14-thread-1]
2022-11-30 17:49:33,562 INFO/App: MSAL acquire token silently success: com.microsoft.identity.client.AuthenticationResult#5709e74 MsalTokenRefreshManager$getTokenSilentlyAsync$4$1$onTaskCompleted$acquireTokenSilentParameters$1.onSuccess()#567 [main]
2022-11-30 17:49:33,563 INFO/Broker: [com.microsoft.identity.common.java.result.LocalAuthenticationResult][2022-11-30 17:49:33 - thread_name: pool-27-thread-2, correlation_id: b27725eb-c6fc-4a0f-bdd5-dd5f3f74270b - Android 30] Id Token type: IdToken ThreadPoolExecutor$Worker.run()#641 [pool-14-thread-1]
2022-11-30 17:49:33,563 INFO/Broker: [com.microsoft.identity.common.java.result.LocalAuthenticationResult][2022-11-30 17:49:33 - thread_name: pool-27-thread-2, correlation_id: b27725eb-c6fc-4a0f-bdd5-dd5f3f74270b - Android 30] Constructing LocalAuthentication result, AccessTokenRecord null: false, AccountRecord null: false, RefreshTokenRecord null or empty: false, IdTokenRecord null: false ThreadPoolExecutor$Worker.run()#641 [pool-14-thread-1]
2022-11-30 17:49:33,564 INFO/App: Token result: Success AadRemoteNgcAuthCheckUseCase$checkForAuth$2.invokeSuspend()#88 [DefaultDispatcher-worker-5]
2022-11-30 17:49:33,564 INFO/Broker: [CommandDispatcher:submitSilent][2022-11-30 17:49:33 - thread_name: pool-27-thread-2, correlation_id: b27725eb-c6fc-4a0f-bdd5-dd5f3f74270b - Android 30] Completed silent request as owner for correlation id : **b27725eb-c6fc-4a0f-bdd5-dd5f3f74270b, with the status : COMPLETED is cacheable : true ThreadPoolExecutor$Worker.run()#641 [pool-14-thread-1]
2022-11-30 17:49:33,564 INFO/App: ListSessionsUseCase request with client request ID: 09871643-7561-4d9a-8e43-567c4d0480cb RemoteAuthenticationManager.listSessions()#201 [DefaultDispatcher-worker-5]
Just to troubleshoot:
I have tried to restart my phone.
Connected with wi-fi and data card.
I tried to check the previous Company A issuer Credential flow is still working and giving me the credential and all are working.
So, it is not an issue from my device and neither is the issue with authenticator connectivity issue from my side.
I think your implementation is based on the following Azure sample.
If so, please comment out the line on VerifierController.cs file under PresentationCallback() method which has a statement like //payload = presentationResponse["issuers"].ToString(). The data in the incoming request payload doesn't have "issuers". Instead of commenting out, you can also use the following:
payload = presentationResponse["verifiedCredentialsData"][0]["issuer"];

VSTS Release Pipeline Gate Success Criteria for HTTPS Status 200

I am trying to use the VSTS release pipeline Gate feature to test a new Azure Function after it's deployed.
I have tried the 'Invoke Azure Function' and 'Invoke REST API' deployment gates, but can't get them to succeed.
I would like to just call the endpoint and for the gate to succeed if it receives a simple HTTP 200 or 202 response.
Latest effort was to put this in the 'Success criteria' field
eq(count(jsonpath('$.responses[?(#.httpStatusCode != 200)]')), 1)
The Processing Gate step just says 'No samples have yet arrived' and there are no logs.
Has anyone successfully done this? Any ideas?
Just faced the same problem for the "Invoke Azure function" task and it is so, that if you simply need to check whether it's 200 or not you don't specify the "Success criteria" at all, it works out of the box. I hope it's the same with the 202.
It's kinda mentioned in their documentation, but as usual you should read between the lines or something.
Completion Event - How the task reports completion. Can be API response (the default) - completion is when function returns
success and success criteria evaluates to true, or Callback -
the Azure function makes a callback to update the timeline record.
Success criteria - How to parse the response body for success.

Integrate extent reports with jmeter for test reporting

I would like to uses jmeter for api functional testing, the jmeter dashboard reporting is not ideal for functional testing.
I have attempted to integrate extent 2.41.2 reporting with groovy script that validates responses (http and expected response code).
I have attempted to use the idea given in Using extentreports for jmeter test results
However that has failed. I used a js2322 assertion to check for valid responses, but then I get errors whenever attempt to run.
I'm not sure whether it should be setup as post processor step instead of an assertion.
Has anyone got any ideas on how this can be achieved?
You can assert result by using prev which is SampleResult:
prev - (SampleResult) - gives access to the previous SampleResult (if any)
Here's example of checking token exists in response and if not return relevant assertion:
import org.apache.jmeter.assertions.AssertionResult;
boolean assertToken = prev.getResponseDataAsString().contains("token");
prev.setSuccessful(assertToken);
if (!assertToken) {
AssertionResult assertionResult = new AssertionResult("Assertion expected to contain token")
assertionResult.setFailureMessage("Assertion failure message: Test failed: text expected to contain /token/");
assertionResult.setFailure(true);
prev.addAssertionResult(assertionResult);
}

Getting error "Action Error: Missing result from request body"

I'm running one of the examples in my own project and running into the error.
Action Error: Missing result from request body
Github Sample Project: dialogflow-silly-name-maker-webhook-nodejs
Hookbin: Shows the webhook coming from the assistant.https://hookbin.com/bin/ZjPzJ1Yb
Might there be an error in the sample code or in my set-up?
I was getting this error. In my case it was because the request object I was passing to ActionsSdkApp() constructor had a body property which was a JSON string as opposed to data structure.
Adding this in before instantiating ActionsSdkApp fixed it for me...
request.body = JSON.parse(request.body);
Then I could carry on like this...
App = new ActionsSdkApp({'request': request, 'response': response});
That error message is printed by the Action on Google client library if the incoming request doesn't have the intent information, but your JSON looks good.
Make sure your action enables debug logging for the client library: process.env.DEBUG = 'actions-on-google:*';
Then study the complete log to understand your issue.

paypal TAXAMT error

I'm trying to add TAXAMT to the transaction. Here's what the query sent:
&PAYMENTREQUEST_0_PAYMENTACTION=Authorization
&RETURNURL=http://zzz.com/returnurl
&CANCELURL=http://zzz.com/cancelurl
&NOSHIPPING=1
&PAYMENTREQUEST_0_CURRENCYCODE=USD
&L_PAYMENTREQUEST_0_QTY0=1
&L_PAYMENTREQUEST_0_NAME0=Shirt
&L_PAYMENTREQUEST_0_AMT0=89.10
&L_PAYMENTREQUEST_0_TAXAMT0=3.56
&PAYMENTREQUEST_0_TAXAMT=3.56
&PAYMENTREQUEST_0_AMT=92.66
but for some reason it's not working. When I add the TAXAMT as a normal item it goes through:
&PAYMENTREQUEST_0_PAYMENTACTION=Authorization
&RETURNURL=http://zzz.com/returnurl
&CANCELURL=http://zzz.com/cancelurl
&NOSHIPPING=1
&PAYMENTREQUEST_0_CURRENCYCODE=USD
&L_PAYMENTREQUEST_0_QTY0=1
&L_PAYMENTREQUEST_0_NAME0=Shirt
&L_PAYMENTREQUEST_0_AMT0=89.10
&L_PAYMENTREQUEST_0_QTY1=1
&L_PAYMENTREQUEST_0_NAME1=Sales+Tax
&L_PAYMENTREQUEST_0_AMT1=3.56
&PAYMENTREQUEST_0_AMT=92.66
Can anyone help me figure out the problem with the TAXAMT. At the moment I get the following error with it:
SetExpressCheckout API call failed.
Detailed Error Message: The totals of the cart item amounts do not match order amounts.
Short Error Message: Transaction refused because of an invalid argument. See additional error messages for details.
Error Code: 10413
Error Severity Code: Error
You're missing:
&PAYMENTREQUEST_0_ITEMAMT=89.10
L_PAYMENTREQUEST_xxxxx indicates the amounts for individual items.
PAYMENTRQUEST_xxxx indicates the total amounts for all items together.