Skip to content

Commit

Permalink
Got rid of node Buffer() deprecation warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Wilaby authored and tonyanziano committed Apr 23, 2019
1 parent 25e6ee2 commit 9af5a5d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [client] Fixed issue where cancelling out of opening a transcript was creating a broken livechat window in PR [1441](https://github.com/Microsoft/BotFramework-Emulator/pull/1441)
- [client] Fixed invisible scrollbar styling in log panel in PR [1442](https://github.com/Microsoft/BotFramework-Emulator/pull/1442)
- [main] Fixed issue where opening a livechat or bot via protocol wasn't working because ngrok wasn't being started on startup in PR [1446](https://github.com/Microsoft/BotFramework-Emulator/pull/1446)
- [main / client] Got rid of node Buffer() deprecation warnings in PR [1426](https://github.com/Microsoft/BotFramework-Emulator/pull/1426)

## Removed
- [main] Removed custom user agent string from outgoing requests in PR [1427](https://github.com/Microsoft/BotFramework-Emulator/pull/1427)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default function startConversation(botEmulator: BotEmulator) {
const botEndpoint: BotEndpoint = (req as any).botEndpoint;
const conversationId =
onErrorResumeNext(() => {
const optionsJson = new Buffer(tokenMatch[1], 'base64').toString('utf8');
const optionsJson = Buffer.from(tokenMatch[1], 'base64').toString('utf8');

return JSON.parse(optionsJson).conversationId;
}) || uniqueId();
Expand Down
6 changes: 3 additions & 3 deletions packages/emulator/core/src/facility/conversation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -526,12 +526,12 @@ export default class Conversation extends EventEmitter {
};

const paymentTokenHeaderStr = JSON.stringify(paymentTokenHeader);
const pthBytes = new Buffer(paymentTokenHeaderStr).toString('base64');
const pthBytes = Buffer.from(paymentTokenHeaderStr).toString('base64');

const paymentTokenSource = 'tok_18yWDMKVgMv7trmwyE21VqO';
const ptsBytes = new Buffer(paymentTokenSource).toString('base64');
const ptsBytes = Buffer.from(paymentTokenSource).toString('base64');

const ptsigBytes = new Buffer('Emulator').toString('base64');
const ptsigBytes = Buffer.from('Emulator').toString('base64');

const updateValue: PaymentRequestComplete = {
id: request.id,
Expand Down

0 comments on commit 9af5a5d

Please sign in to comment.