Skip to content

Commit 87ae32f

Browse files
author
mdrichardson
committed
change max url length and add notes
1 parent 2b6438d commit 87ae32f

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

samples/javascript_nodejs/80.skills-simple-bot-to-bot/simple-root-bot/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,10 @@ const skillClient = new SkillHttpClient(credentialProvider, conversationIdFactor
123123
// Create the main dialog.
124124
const bot = new RootBot(conversationState, skillsConfig, skillClient);
125125

126-
// Create HTTP server
127-
const server = restify.createServer();
126+
// Create HTTP server.
127+
// maxParamLength defaults to 100, which is too short for the conversationId created in skillConversationIdFactory
128+
// See: https://github.com/microsoft/BotBuilder-Samples/issues/2194
129+
const server = restify.createServer({ maxParamLength: 1000 });
128130
server.listen(process.env.port || process.env.PORT || 3978, function() {
129131
console.log(`\n${ server.name } listening to ${ server.url }`);
130132
console.log('\nGet Bot Framework Emulator: https://aka.ms/botframework-emulator');

samples/javascript_nodejs/80.skills-simple-bot-to-bot/simple-root-bot/skillConversationIdFactory.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ class SkillConversationIdFactory extends SkillConversationIdFactoryBase {
1818
conversationReference: TurnContext.getConversationReference(options.activity),
1919
oAuthScope: options.fromBotOAuthScope
2020
};
21-
// This key has a 100 character limit.
22-
const key = `${ options.fromBotId }-${ skillConversationReference.conversationReference.conversation.id }-skillconvo`;
21+
// This key has a 100 character limit by default. Increase with `restify.createServer({ maxParamLength: 1000 });` in index.js
22+
const key = `${ options.fromBotId }-${ options.botFrameworkSkill.appId }-${ skillConversationReference.conversationReference.conversation.id }-${ skillConversationReference.conversationReference.channelId }-skillconvo`;
2323
this.refs[key] = skillConversationReference;
2424
return key;
2525
}

samples/javascript_nodejs/81.skills-skilldialog/dialogRootBot/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,9 @@ const mainDialog = new MainDialog(conversationState, skillsConfig, skillClient,
138138
const bot = new RootBot(conversationState, mainDialog);
139139

140140
// Create HTTP server.
141-
const server = restify.createServer();
141+
// maxParamLength defaults to 100, which is too short for the conversationId created in skillConversationIdFactory
142+
// See: https://github.com/microsoft/BotBuilder-Samples/issues/2194
143+
const server = restify.createServer({ maxParamLength: 1000 });
142144
server.listen(process.env.port || process.env.PORT || 3978, function() {
143145
console.log(`\n${ server.name } listening to ${ server.url }`);
144146
console.log('\nGet Bot Framework Emulator: https://aka.ms/botframework-emulator');

samples/javascript_nodejs/81.skills-skilldialog/dialogRootBot/skillConversationIdFactory.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ class SkillConversationIdFactory extends SkillConversationIdFactoryBase {
1818
conversationReference: TurnContext.getConversationReference(options.activity),
1919
oAuthScope: options.fromBotOAuthScope
2020
};
21-
// This key has a 100 character limit.
22-
const key = `${ options.fromBotId }-${ skillConversationReference.conversationReference.conversation.id }-skillconvo`;
21+
// This key has a 100 character limit by default. Increase with `restify.createServer({ maxParamLength: 1000 });` in index.js
22+
const key = `${ options.fromBotId }-${ options.botFrameworkSkill.appId }-${ skillConversationReference.conversationReference.conversation.id }-${ skillConversationReference.conversationReference.channelId }-skillconvo`;
2323
this.refs[key] = skillConversationReference;
2424
return key;
2525
}

0 commit comments

Comments
 (0)