Many popup errors when saving intent - dialogflow-es

I get many pop up errors like so :
Failed to upload action package to AOG (preview)
Request contains an invalid argument.
The query pattern '$SchemaOrg_Number:numberx $SchemaOrg_Number:number2x $SchemaOrg_Number:number3' contains an undefined parameter (name: 'number2x' type: 'SchemaOrg_Number')
when I try to save my intent.
However when I navigate to test my google action , it seems to be working fine (it recognises the parameters when I give my application the same expression structure that I define in my training phrases)
It shouldn't be a problem , but I would like to submit my app for alpha testing, and when I do so I get an error of a similar nature:
The query pattern '$SchemaOrg_Number:numberx $SchemaOrg_Number:number2x $SchemaOrg_Number:number3' contains an undefined parameter (name: 'number2x' type: 'SchemaOrg_Number')
What is causing this error and how can I try and fix it?
Cheers!

Related

Is there a way to resolve this error: "CloudKit integration requires does not support ordered relationships."

I'm trying to use Apple's CoreDataCloudkitDemo app. I've only changed the app settings per their README document. On running the demo, I'm getting the error: "CloudKit integration requires does not support ordered relationships."
(The weird grammar in the title is included in the app)
The console log shows:
Fatal error: ###persistentContainer: Failed to load persistent stores:Error Domain=NSCocoaErrorDomain Code=134060 "A Core Data error occurred." UserInfo={NSLocalizedFailureReason=CloudKit integration requires does not support ordered relationships. The following relationships are marked ordered:
Post: attachments
There is the same error for the "Tags" entity.
I'm using Xcode 11.0 beta 4 (11M374r).
I've only changed the bundle identifier, and set my Team Id.
I removed the original entitlements file - no errors in resulting build.
I've not changed any code from the original.
Does anyone have a workaround, or preferably, a fix? Or did I do something wrong?
Thanks
Firstly, select CoreDataCloudKitDemo.xcdatamodeld -> Post -> RelationShips, select attachments relationship, on the Inspect panel, deselect Ordered, then do the same thing on the tags relationship.
Secondly, there will be some errors in the code now, because we unchecked the Ordered option, the property of attachments and tags in the generated NSManagedObject may changed from NSOrderedSet? to NSSet?. So we could change these error lines of code like below:
Origin:
guard let tag = post?.tags?.object(at: indexPath.row) as? Tag else { return cell }
Changed:
guard let tag = post?.tags?.allObjects[indexPath.row] as? Tag else { return cell }
Finally, you can run the code now. ;-)
Further more, on WWDC19 Session 202, the demo shows they set both attachments and tags relationships as Unordered, so I think there's something wrong in the given demo project.

Cloud Firestore node.js invalid use of type "object" as a Firestore argument

My question is about why I can't seem to pass data into a Firestore database. I'm running code on node.js trying to parse data coming from my Firebase Firestore database and then return information back to the database. Retrieval of the information works fine, but an error message that I cannot escape for the life of me keeps appearing when trying to pass data back to the database.
if(message.type = "0") {
console.log(0)
db.collection("outbox").doc("messageID").set({message: "test message"})
}
On trying to process the last line of code, the following error message appears:
Error: Argument "data" is not a valid Firestore document. Invalid use of type "object" as a Firestore argument.
My database is structured as outbox/messageID/message. Message holds a string value and I'm using the admin SDK so write issues aren't a problem. I'm doing something wrong with passing the object along to Firebase but I just can't figure it out. This is my first time working with Cloud Firestore and node.js but I've done small-scale projects in HTML/JS before.
It looks like an internal error with the way firestore checks if a value is an array.
I have the same issue trying a simple
db.collection('Test').add({ foo: 'bar' })
Which leads to
Error: Value for argument "data" is not a valid Firestore document. Invalid use of type "object" as a Firestore argument
After digging into firebase source code i found they check if an object is an object, based on this test :
Object.getPrototypeOf(input) === Object.prototype
Which is false in some environments for some unknwon reasons (In my case: Node v10.15.3 CLI)
As a workaround if you temporary needs to have this works, you may edit your node module source code in this file : node_modules/#google-cloud/firestore/build/src/serializer.js
Change the isPlainObject function to :
function isPlainObject(input) {
return util_1.isObject(input);
}

Azure Stream Analytics: "Stream Analytics job has validation errors: The given key was not present in the dictionary."

I burned a couple of hours on a problem today and thought I would share.
I tried to start up a previously-working Azure Stream Analytics job and was greeted by a quick failure:
Failed to start Streaming Job 'shayward10ProcessLogs'.
I looked at the JSON log and found nothing helpful whatsoever. The only description of the problem was:
Stream Analytics job has validation errors: The given key was not present in the dictionary.
Given the error and some changes to our database, I tried the following to no effect:
Deleting and Recreating all Inputs
Deleting and Recreating all Outputs
Running tests against the data (coming from Event Hub) and the output looked good
My query looked as followed:
SELECT
dateTimeUtc,
context.tenantId AS tenantId,
context.userId AS userId,
context.deviceId AS deviceId,
changeType,
dataType,
changeStatus,
failureReason,
ipAddress,
UDF.JsonToString(details) AS details
INTO
[MyOutput]
FROM
[MyInput]
WHERE
logType = 'MyLogType';
Nothing made sense so I started deconstructing my query. I took it down to a single field and it succeeded. I went field by field, trying to figure out which field (if any) was the cause.
See my answer below.
The answer was simple (yet frustrating). When I got to the final field, that's where the failure was:
UDF.JsonToString(details) AS details
This was the only field that used a user-defined function. After futsing around, I noticed that the Function Editor showed the title of the function as:
udf.JsonToString
It was a casing issue. I had UDF in UPPERCASE and Azure Stream Analytics expected it in lowercase. I changed my final field to:
udf.JsonToString(details) AS details
It worked.
The strange thing is, it was previously working. Microsoft may have made a change to Azure Stream Analytics to make it case-sensitive in a place where it seemingly wasn't before.
It makes sense, though. JavaScript is case-sensitive. Every JavaScript object is basically a dictionary of members. Consider the error:
Stream Analytics job has validation errors: The given key was not present in the dictionary.
The "udf" object had a dictionary member with my function in it. The UDF object would be undefined. Undefined doesn't have my function as a member.
I hope my 2-hour head-banging session helps someone else.

Swagger API "required" - how much is this required?

I've created a Swagger (on nodejs/express) test API with this specification (only relevant part):
...
parameters:
- name: name
in: query
required: true
type: string
...
But I can call the url with empty paramter, for example
http://localhost/test?name=
And it works without any problem, throws no exception or any other sign. Why?
If I make a similar call from the terminal via curl or via postman, it works as well. I parsed the query from the request object and found that in this case, the query parameter is interpreted as an empty string.
Making the call via SwaggerUI is different though, as the UI will actually not make the call UNLESS the query field has a value.
Try doing console.log(req.query); in your handler. You will probably see {name: ''}. Which is legitimate, just that the value of name is an empty string.
Look at JSON4 here: Representing null in JSON. So name IS defined, but it's empty.
You will probably need to do a check for empty string values.
I hope this helps!

Remove collection from model RacerJS?

This is my client Side code:
model.remove('agent',{'text':'online'});
I cant able to remove collection from model,Its shows following error in console
Error: remove must be performed under a collection and document id. Invalid path: agent
From the documentation, it looks like 'path' should be the collectionname.id. In this case, maybe I suppose it should be 'agent.id'.
This blog refers that the path should be in the format collection.documentId.document.
http://blog.derbyjs.com/2012/04/13/derby-v0-dot-3-0/

Resources