Skip to content
Merged
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
34 changes: 0 additions & 34 deletions packages/core/src/amazonqDoc/controllers/chat/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import { getLogger } from '../../../shared/logger'

import { Session } from '../../session/session'
import { i18n } from '../../../shared/i18n-helper'
import { telemetry } from '../../../shared/telemetry'
import path from 'path'
import { createSingleFileDialog } from '../../../shared/ui/common/openDialog'
import { MynahIcons } from '@aws/mynah-ui'
Expand Down Expand Up @@ -187,12 +186,6 @@ export class DocController {
const codeGenerationId: string = message.messageId
const zipFilePath: string = message.filePath
const session = await this.sessionStorage.getSession(tabId)
telemetry.amazonq_isReviewedChanges.emit({
amazonqConversationId: session.conversationId,
enabled: true,
result: 'Succeeded',
credentialStartUrl: AuthUtil.instance.startUrl,
})

const workspacePrefixMapping = getWorkspaceFoldersByPrefixes(session.config.workspaceFolders)
const pathInfos = getPathsFromZipFilePath(zipFilePath, workspacePrefixMapping, session.config.workspaceFolders)
Expand Down Expand Up @@ -357,7 +350,6 @@ export class DocController {
}

private async fileClicked(message: any) {
// TODO: add Telemetry here
const tabId: string = message.tabID
const messageId = message.messageId
const filePathToUpdate: string = message.filePath
Expand Down Expand Up @@ -397,12 +389,6 @@ export class DocController {
private async newTask(message: any) {
// Old session for the tab is ending, delete it so we can create a new one for the message id
this.docGenerationTask = new DocGenerationTask()
const session = await this.sessionStorage.getSession(message.tabID)
telemetry.amazonq_endChat.emit({
amazonqConversationId: session.conversationId,
amazonqEndOfTheConversationLatency: performance.now() - session.telemetry.sessionStartTime,
result: 'Succeeded',
})
this.sessionStorage.deleteSession(message.tabID)

// Re-run the opening flow, where we check auth + create a session
Expand All @@ -419,14 +405,7 @@ export class DocController {
this.messenger.sendUpdatePlaceholder(message.tabID, i18n('AWS.amazonq.featureDev.placeholder.sessionClosed'))
this.messenger.sendChatInputEnabled(message.tabID, false)

const session = await this.sessionStorage.getSession(message.tabID)
this.docGenerationTask.reset()

telemetry.amazonq_endChat.emit({
amazonqConversationId: session.conversationId,
amazonqEndOfTheConversationLatency: performance.now() - session.telemetry.sessionStartTime,
result: 'Succeeded',
})
}

private processErrorChatMessage = (err: any, message: any, session: Session | undefined) => {
Expand Down Expand Up @@ -492,7 +471,6 @@ export class DocController {
}

private async stopResponse(message: any) {
telemetry.ui_click.emit({ elementId: 'amazonq_stopCodeGeneration' })
this.messenger.sendAnswer({
message: i18n('AWS.amazonq.featureDev.pillText.stoppingCodeGeneration'),
type: 'answer-part',
Expand Down Expand Up @@ -679,18 +657,6 @@ export class DocController {
try {
session = await this.sessionStorage.getSession(message.tabID)

const acceptedFiles = (paths?: { rejected: boolean }[]) => (paths || []).filter((i) => !i.rejected).length

const amazonqNumberOfFilesAccepted =
acceptedFiles(session.state.filePaths) + acceptedFiles(session.state.deletedFiles)

telemetry.amazonq_isAcceptedCodeChanges.emit({
credentialStartUrl: AuthUtil.instance.startUrl,
amazonqConversationId: session.conversationId,
amazonqNumberOfFilesAccepted,
enabled: true,
result: 'Succeeded',
})
await session.insertChanges()

const readmePath = findReadmePath(session.state.filePaths)
Expand Down
Loading