Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Update contexts.js #276

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update contexts.js #276

wants to merge 1 commit into from

Conversation

ZwitsaI
Copy link

@ZwitsaI ZwitsaI commented Nov 19, 2019

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"

Change _processV2InputContexts(v2InputContexts) function, extract name last of splitted context name instead of fixed 6th position
@googlebot
Copy link

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).

📝 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
Copy link
Author

ZwitsaI commented Nov 22, 2019

@googlebot I signed it!

@willpomac
Copy link

Any progress on this ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants