Skip to content

Commit

Permalink
Merge 8d75225 into ffa96e8
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyanziano committed Oct 22, 2019
2 parents ffa96e8 + 8d75225 commit 0007fa5
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -83,6 +83,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [client] Applied theming to InsetShadow component in PR [1922](https://github.com/microsoft/BotFramework-Emulator/pull/1922)
- [client] Bumped Web Chat to v4.5.3 in PR [1925](https://github.com/microsoft/BotFramework-Emulator/pull/1925)
- [client] Fixed issue that was causing Web Chat interactions to clear Adaptive Card content in PR [1930](https://github.com/microsoft/BotFramework-Emulator/pull/1930)
- [client/main] Added a new property, `source`, to the `bot_open` telemetry event to distinguish between bots opened via .bot file and via url, in PR [1937](https://github.com/microsoft/BotFramework-Emulator/pull/1937)


## v4.5.2 - 2019 - 07 - 17
Expand Down
1 change: 1 addition & 0 deletions packages/app/client/src/commands/botCommands.spec.ts
Expand Up @@ -130,6 +130,7 @@ describe('The bot commands', () => {
expect(remoteCallArgs[0][2]).toEqual({
method: 'bots_list',
numOfServices: undefined,
source: 'path',
});
});

Expand Down
1 change: 1 addition & 0 deletions packages/app/client/src/commands/botCommands.ts
Expand Up @@ -68,6 +68,7 @@ export class BotCommands {
await this.commandService.remoteCall(Commands.Telemetry.TrackEvent, 'bot_open', {
method: 'bots_list',
numOfServices,
source: 'path',
});
return ActiveBotHelper.confirmAndSwitchBots(bot);
} catch (e) {
Expand Down
6 changes: 6 additions & 0 deletions packages/app/client/src/state/sagas/botSagas.ts
Expand Up @@ -82,6 +82,7 @@ export class BotSagas {
yield put(errorNotification);
}
}

// Currently restarts a conversation with an unchanged ID
public static *restartConversation(action: BotAction<RestartConversationPayload>): IterableIterator<any> {
const serverUrl = yield select((state: RootState) => state.clientAwareSettings.serverUrl);
Expand Down Expand Up @@ -195,6 +196,11 @@ export class BotSagas {
SharedConstants.Commands.Settings.SaveBotUrl,
action.payload.endpoint
);
BotSagas.commandService.remoteCall(SharedConstants.Commands.Telemetry.TrackEvent, 'bot_open', {
method: null, // this code path can be hit by multiple methods
numOfServices: 0,
source: 'url',
});
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions packages/app/client/src/ui/helpers/activeBotHelper.spec.ts
Expand Up @@ -73,11 +73,13 @@ jest.mock('electron', () => ({

describe('ActiveBotHelper tests', () => {
let commandService: CommandServiceImpl;

beforeAll(() => {
const decorator = CommandServiceInstance();
const descriptor = decorator({ descriptor: {} }, 'none') as any;
commandService = descriptor.descriptor.get();
});

it('confirmSwitchBot() functionality', async () => {
(editorHelpers as any).hasNonGlobalTabs = jest
.fn()
Expand Down Expand Up @@ -287,6 +289,7 @@ describe('ActiveBotHelper tests', () => {
expect(mockRemoteCall).toHaveBeenCalledWith(SharedConstants.Commands.Telemetry.TrackEvent, 'bot_open', {
method: 'file_browse',
numOfServices: 0,
source: 'path',
});

ActiveBotHelper.browseForBotFile = backupBrowseForBotFile;
Expand Down
1 change: 1 addition & 0 deletions packages/app/client/src/ui/helpers/activeBotHelper.ts
Expand Up @@ -215,6 +215,7 @@ export class ActiveBotHelper {
.remoteCall(Telemetry.TrackEvent, `bot_open`, {
method: 'file_browse',
numOfServices,
source: 'path',
})
.catch(_e => void 0);
}
Expand Down
3 changes: 3 additions & 0 deletions packages/app/main/src/protocolHandler.spec.ts
Expand Up @@ -403,6 +403,7 @@ describe('Protocol handler tests', () => {
expect(mockTrackEvent).toHaveBeenCalledWith('bot_open', {
method: 'protocol',
numOfServices: 1,
source: 'path',
});
});

Expand Down Expand Up @@ -431,6 +432,7 @@ describe('Protocol handler tests', () => {
expect(mockTrackEvent).toHaveBeenCalledWith('bot_open', {
method: 'protocol',
numOfServices: 1,
source: 'path',
});
});

Expand Down Expand Up @@ -459,6 +461,7 @@ describe('Protocol handler tests', () => {
expect(mockTrackEvent).toHaveBeenCalledWith('bot_open', {
method: 'protocol',
numOfServices: 1,
source: 'path',
});
});

Expand Down
1 change: 1 addition & 0 deletions packages/app/main/src/protocolHandler.ts
Expand Up @@ -306,6 +306,7 @@ class ProtocolHandlerImpl implements ProtocolHandler {
TelemetryService.trackEvent('bot_open', {
method: 'protocol',
numOfServices,
source: 'path',
});
}
}
Expand Down

0 comments on commit 0007fa5

Please sign in to comment.