Skip to content
This repository was archived by the owner on Jan 5, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased

## v4.8.1 - 2019 - 03 - 18
## Fixed
- [build] Replaced a missing .icns file that was deleted by mistake in a previous PR. Fixes the app icon on Linux & Mac in PR [2104](https://github.com/microsoft/BotFramework-Emulator/pull/2104)
- [client] Fixed an issue where Restart activity wont appear on selected activity after restarting once in PR [2105](https://github.com/microsoft/BotFramework-Emulator/pull/2105)
- [client] Disable "Restart conversation from here" bubble on DL Speech bots [2107](https://github.com/microsoft/BotFramework-Emulator/pull/2107)
- [client] Fixed an issue where starting a conversation with an unset custom user ID was causing the User member of the conversation to have a blank `id` field in PR [2108](https://github.com/microsoft/BotFramework-Emulator/pull/2108)
- [main] Fixed an issue where the setting `Bypass Ngrok for local addresses` was continuing to use the ngrok tunnel even for local bots in PR [2111](https://github.com/microsoft/BotFramework-Emulator/pull/2111)
- [main] Ngrok Reporting made accurate in PR [2113](https://github.com/microsoft/BotFramework-Emulator/pull/2113)

## v4.8.0 - 2019 - 03 - 12
## Added
- [client/main] Added Ngrok Status Viewer in PR [2032](https://github.com/microsoft/BotFramework-Emulator/pull/2032)
Expand Down
24 changes: 12 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

79 changes: 76 additions & 3 deletions packages/app/client/src/state/sagas/botSagas.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ describe('The botSagas', () => {
expect(putNotification.value).toEqual(put(errorNotification));
});

it('should open a bot via url', () => {
it('should open a bot via url with the custom user ID', () => {
const mockAction: any = {
payload: {
endpoint: 'http://localhost:3978/api/messages',
Expand All @@ -213,13 +213,86 @@ describe('The botSagas', () => {
const gen = BotSagas.openBotViaUrl(mockAction);
gen.next();
gen.next('userId'); // select custom user GUID
gen.next('http://localhost:52673'); // select server url

// select server url
expect(gen.next('http://localhost:52673').value).toEqual(
call([ConversationService, ConversationService.startConversation], 'http://localhost:52673', {
botUrl: mockAction.payload.endpoint,
channelServiceType: mockAction.payload.channelService,
members: [{ id: 'userId', name: 'User', role: 'user' }],
mode: mockAction.payload.mode,
msaAppId: mockAction.payload.appId,
msaPassword: mockAction.payload.appPassword,
})
);

const mockStartConvoResponse = {
json: async () => undefined,
ok: true,
};
gen.next(mockStartConvoResponse); // startConversation

// startConversation
gen.next(mockStartConvoResponse);
gen.next({
conversationId: 'someConvoId',
endpointId: 'someEndpointId',
members: [],
}); //res.json()

let next = gen.next(); // bootstrapChat()

const putOpenValue = next.value;
expect(putOpenValue).toEqual(
put(
openEditorDocument({
contentType: SharedConstants.ContentTypes.CONTENT_TYPE_LIVE_CHAT,
documentId: 'someConvoId',
isGlobal: false,
})
)
);
gen.next(); // put open()

gen.next({ ok: true }); // sendInitialLogReport()
next = gen.next({ ok: true }); // sendInitialActivity()

const callValue = next.value;
expect(callValue).toEqual(
call(
[commandService, commandService.remoteCall],
SharedConstants.Commands.Settings.SaveBotUrl,
'http://localhost:3978/api/messages'
)
);
expect(gen.next().done).toBe(true);
});

it('should open a bot via url with a newly generated user GUID', () => {
const mockAction: any = {
payload: {
endpoint: 'http://localhost:3978/api/messages',
channelService: 'public',
mode: 'livechat',
appId: 'someAppId',
appPassword: 'someAppPw',
},
};
const gen = BotSagas.openBotViaUrl(mockAction);
gen.next();
gen.next(''); // select custom user GUID (force generation of new GUID)

// select server url
const startConversationCall = gen.next('http://localhost:52673').value;
const startConversationPayload = startConversationCall.CALL.args[1];
expect(startConversationPayload.members[0].id.length).toBeGreaterThan(0);

const mockStartConvoResponse = {
json: async () => undefined,
ok: true,
};

// startConversation
gen.next(mockStartConvoResponse);
gen.next({
conversationId: 'someConvoId',
endpointId: 'someEndpointId',
Expand Down
5 changes: 3 additions & 2 deletions packages/app/client/src/state/sagas/botSagas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,9 @@ export class BotSagas {
public static *openBotViaUrl(
action: BotAction<StartConversationParams & { isFromBotFile?: boolean }>
): IterableIterator<any> {
const customUserId = yield select(getCustomUserGUID);
const user = {
id: yield select(getCustomUserGUID) || uniqueIdv4(), // use custom id or generate new one
id: customUserId || uniqueIdv4(), // use custom id or generate new one
name: 'User',
role: 'user',
};
Expand All @@ -110,7 +111,7 @@ export class BotSagas {
msaAppId: action.payload.appId,
msaPassword: action.payload.appPassword,
};
let res: Response = yield ConversationService.startConversation(serverUrl, payload);
let res: Response = yield call([ConversationService, ConversationService.startConversation], serverUrl, payload);
if (!res.ok) {
yield* throwErrorFromResponse('Error occurred while starting a new conversation', res);
}
Expand Down
10 changes: 8 additions & 2 deletions packages/app/client/src/state/sagas/chatSagas.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -824,10 +824,13 @@ describe('The ChatSagas,', () => {
// put webSpeechFactoryUpdated
expect(gen.next().value).toEqual(put(webSpeechFactoryUpdated(payload.documentId, undefined)));

// select custom user GUID
expect(gen.next().value).toEqual(select(getCustomUserGUID));

// call updateConversation
const conversationId = chat.conversationId;
const userId = chat.userId;
expect(gen.next().value).toEqual(
expect(gen.next('').value).toEqual(
call([ConversationService, ConversationService.updateConversation], serverUrl, chat.conversationId, {
conversationId,
userId,
Expand Down Expand Up @@ -957,10 +960,13 @@ describe('The ChatSagas,', () => {
// put webSpeechFactoryUpdated
expect(gen.next().value).toEqual(put(webSpeechFactoryUpdated(payload.documentId, undefined)));

// select custom user GUID
expect(gen.next().value).toEqual(select(getCustomUserGUID));

// call updateConversation
const conversationId = chat.conversationId;
const userId = chat.userId;
expect(gen.next().value).toEqual(
expect(gen.next('').value).toEqual(
call([ConversationService, ConversationService.updateConversation], serverUrl, chat.conversationId, {
conversationId,
userId,
Expand Down
6 changes: 4 additions & 2 deletions packages/app/client/src/state/sagas/chatSagas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,8 @@ export class ChatSagas {
const { filename } = action.payload;
// start a conversation
const serverUrl = yield select(getServerUrl);
const user = { id: yield select(getCustomUserGUID) || uniqueIdv4(), name: 'User', role: 'user' };
const customUserId = yield select(getCustomUserGUID);
const user = { id: customUserId || uniqueIdv4(), name: 'User', role: 'user' };
const payload = {
botUrl: '',
channelServiceType: '' as any,
Expand Down Expand Up @@ -535,7 +536,8 @@ export class ChatSagas {
userId = uniqueIdv4();
} else {
// use the previous id or the custom id from settings
userId = chat.userId || (yield select(getCustomUserGUID));
const customUserId = yield select(getCustomUserGUID);
userId = chat.userId || customUserId;
}

// update the main-side conversation object with conversation & user IDs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,18 +139,13 @@ export class Chat extends PureComponent<ChatProps, ChatState> {
}

private activityWrapper(next, card, children): ReactNode {
const { mode, restartStatus } = this.props;
const isWebChatDisabled =
mode === 'transcript' || mode === 'debug' || restartStatus === RestartConversationStatus.Started;
return (
<OuterActivityWrapperContainer
card={card}
documentId={this.props.documentId}
onContextMenu={this.onContextMenu}
onItemRendererClick={this.onItemRendererClick}
onItemRendererKeyDown={this.onItemRendererKeyDown}
restartStatusForActivity={this.props.restartStatus}
isWebChatDisabled={isWebChatDisabled}
>
{next(card)(children)}
</OuterActivityWrapperContainer>
Expand Down
Loading