dialogflow / dialogflow-fulfillment-nodejs

Dialogflow agent fulfillment library supporting v1&v2, 8 platforms, and text, card, image, suggestion, custom responses
Apache License 2.0
597 stars 281 forks source link

Update contexts.js #276

Open ZwitsaI opened 4 years ago

ZwitsaI commented 4 years ago

Change _processV2InputContexts(v2InputContexts) function: Extract name not from fixed 6th position,

const name = context['name'].split('/')[6];

but from last in the split

let name = context['name'].split('/'); name = name[name.length-1];

In requests that come in to the draft version contain the context name on the 6th/last position "name": "projects/project-name/agent/sessions/ABwppplpq8QomdH91Z8YeWbZM1vvK04Ty6-2NEwAe5-Ur3Nc9GUAt3fyguV0YavLfQBNlLhYUFGQY35Gxm913Iefk/contexts/userdata"

In alpha test it's not the 6th but it's still the last position. "name": "projects/project-name/agent/environments/__aog-30/users/-/sessions/ABwppHERR9ORcqJ4vEVSu1XxN3xTolEN7Pq1fUXhOBNaker5yA8ljmI9Wnp8uOZ2rdVVAS4s9Twxa-tjAH45X495K/contexts/userdata"

googlebot commented 4 years ago

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

ZwitsaI commented 4 years ago

@googlebot I signed it!

willpomac commented 3 years ago

Any progress on this ?