Skip to content

Conversation

@tnaum-ms
Copy link
Collaborator

@tnaum-ms tnaum-ms commented Jun 16, 2025

Copilot AI and others added 30 commits May 26, 2025 15:25
…-documentdb into dev/xingfan/111-copy-and-paste-2-implement-basic-copy-and-paste-task
…into dev/xingfan/111-copy-and-paste-2-implement-basic-copy-and-paste-task
@tnaum-ms
Copy link
Collaborator Author

@copilot This branch is out-of-date with the base branch. Merge the latest changes from next into this branch. Resolve conflicts:
bundle.l10n.json can be ignored/replaced with any version - simply run 'npm run l10n' to generate a new one.
for docs/learn-more/index.md, use the version from 'next'

Copy link
Contributor

Copilot AI commented Nov 27, 2025

@tnaum-ms I've opened a new pull request, #409, to work on those changes. Once the pull request is ready, I'll request review from you.

@tnaum-ms tnaum-ms force-pushed the feature/copy-and-paste branch from d1706ce to b9346e3 Compare November 27, 2025 15:54
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 52 out of 54 changed files in this pull request and generated 1 comment.

@tnaum-ms tnaum-ms added this to the 0.7.0 "January 2025" milestone Jan 2, 2026
# Conflicts:
#	.github/copilot-instructions.md
#	l10n/bundle.l10n.json
#	src/commands/addConnectionFromRegistry/addConnectionFromRegistry.ts
#	src/commands/newConnection/ExecuteStep.ts
#	src/commands/removeConnection/removeConnection.ts
#	src/documentdb/ClustersExtension.ts
…tion steps

- Added ConfirmDeleteStep to prompt user for confirmation before deletion.
- Introduced VerifyStep to check for running tasks using connections in the folder.
- Created ExecuteStep to handle the actual deletion of folders and connections.
- Defined DeleteFolderWizardContext to manage state throughout the wizard.
- Refactored deleteFolder command to utilize the new wizard structure.
- Updated tests to cover new functionality and ensure correct behavior during deletion.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 66 out of 68 changed files in this pull request and generated 7 comments.

}

// Use Intl.NumberFormat for compact notation
const formatter = new Intl.NumberFormat('en', {
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The locale is hardcoded to 'en'. Consider using the user's VS Code locale for better internationalization. You can access this via vscode.env.language or use 'en-US' as a more specific locale identifier.

Copilot uses AI. Check for mistakes.
Comment on lines +53 to +57
public loadDocumentCount(): void {
// Skip if already loading or already loaded
if (this.isLoadingCount || this.documentCount !== undefined) {
return;
}
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Race condition: this.isLoadingCount is set to true after the check, creating a small window where multiple calls could pass the check. Set this.isLoadingCount = true immediately after entering the function body and before the check to prevent concurrent loads.

Copilot uses AI. Check for mistakes.
await callWithTelemetryAndErrorHandling('taskService.taskExecution', async (context: IActionContext) => {
// Add base task properties with task_ prefix
context.telemetry.properties.task_id = this.id;
context.telemetry.properties.task_type = this.constructor.name;
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent telemetry property: Line 279 uses this.type but line 321 uses this.constructor.name. These should both use this.type for consistency across initialization and execution telemetry.

Copilot uses AI. Check for mistakes.
}

// Move to next batch - account for both partial progress and final result
const totalProcessedInBatch = partialProgressCount + result.processedCount;
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable name totalProcessedInBatch is misleading. This represents the number of documents to skip from pendingDocs, not a total count. Consider renaming to documentsToSkip or processedSoFar for clarity.

Copilot uses AI. Check for mistakes.
Comment on lines +269 to +271
let cleanup: () => void;

if (abortSignal) {
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable cleanup is used before assignment. If abortSignal is falsy, line 265's cleanup() will execute before cleanup is assigned on line 284. Move the cleanup function declaration before the timeout setup or initialize it with a no-op function.

Copilot uses AI. Check for mistakes.
* @param _actionContext Optional action context for telemetry (currently unused)
* @returns Promise resolving to the estimated document count
*/
protected async countDocumentsInDatabase(_signal?: AbortSignal, _actionContext?: IActionContext): Promise<number> {
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The _signal parameter is unused despite being part of the interface contract. While this may be intentional for the current implementation, consider adding a comment explaining why AbortSignal isn't used with estimateDocumentCount, or add support for cancellation if the underlying API supports it.

Copilot uses AI. Check for mistakes.
}
return `${existingLabel} (1)`;
// Fallback to prevent endless loop if regex fails - use timestamp for guaranteed uniqueness
return `${existingLabel} (${Date.now()})`;
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using Date.now() creates labels like 'My Collection (1737028800000)' which is not user-friendly. Consider using a more readable timestamp format or a simpler counter. The timestamp is also guaranteed unique but unnecessarily long.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Easy Lightweight Data Migrations 🚀 Copy-and-Paste: 7. Comprehensive Testing and Validation

3 participants