microsoft / microsoft/vscode-documentdb

Remove legacy Local Emulators tree and storage zone

Open
#870 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
31
Forks
22
Avg merge
2d 20h
Merged PRs (30d)
21

Description

Summary

Complete the cleanup started by the DocumentDB Local Quick Start migration. The dedicated Local Emulators tree and Emulators storage zone are retired from the normal post-migration experience, but their records, APIs, commands, and compatibility branches remain in the codebase.

Current state

The one-time migration copies each stored Emulator-zone connection into the regular Clusters zone under the shared Local Connections (Legacy) folder:

  • Migrated connections receive deterministic IDs (legacy_<originalId>).
  • Their emulatorConfiguration is retained for local TLS behavior.
  • The copied records use storageZone: Clusters, so normal folder/path reconstruction works.
  • LocalEmulatorsItem is hidden only after migration completes.
  • Original Emulator-zone records are intentionally retained as rollback data.

The old architecture still remains:

  • StorageZone.Emulators / ConnectionType.Emulators are public storage variants.
  • LocalEmulatorsItem and its nested folder rendering still exist.
  • Startup and tree-empty checks still read the Emulator zone.
  • Local connection creation and several rename/update/move commands still contain Emulator-zone routing.
  • URI handling may still write to the Emulator zone before migration completes.
  • Storage cleanup and tests continue to support both zones.
  • Partial migration exposes the legacy tree, whose synthetic localEmulators path is incompatible with Collection View's current Clusters-only lookup.

Goal

Make regular Clusters storage plus emulatorConfiguration the only persisted model for local connections, and remove the obsolete Local Emulators tree/storage architecture after a safe compatibility window.

Proposed work

  1. Define the final migration/removal policy for original Emulator-zone data, including upgrade and rollback expectations.
  2. Ensure migration is durable and idempotent for all existing records, folders, secrets, auth configuration, and deep-link races.
  3. Route every new local connection to StorageZone.Clusters regardless of migration state.
  4. Remove LocalEmulatorsItem, its empty-state action, and Emulator-specific folder creation/navigation.
  5. Remove Emulator-zone branches from rename, move, update credentials, update connection string, delete, reveal, URI handling, and duplicate detection.
  6. Remove StorageZone.Emulators / deprecated ConnectionType.Emulators once no persisted compatibility read is required.
  7. Simplify connection presentation and TLS behavior to depend on emulatorConfiguration, not storage location.
  8. Remove obsolete migration flags and rollback code when the supported upgrade window permits it.
  9. Update storage contracts, cleanup logic, telemetry, localization, documentation, and tests.

Acceptance criteria

  • Existing local connections upgrade into the regular Connections hierarchy without losing secrets, auth settings, names, or TLS behavior.
  • New local connections never write to an Emulator-specific zone.
  • No Local Emulators synthetic tree node remains.
  • All connection operations use normal Clusters-zone identity and parent-path reconstruction.
  • emulatorConfiguration remains the sole indicator for local/emulator behavior.
  • Emulator-zone APIs and dead compatibility branches are removed, or any temporarily retained read-only migration boundary is explicitly documented with a removal condition.
  • Focused migration tests cover empty, successful, partial/retry, folder-flattening, and concurrent/deep-link cases.

Out of scope

Quick Start managed instances are service-owned and in-memory rather than stored connections. Their Collection View tree resolution should be repaired separately through the Quick Start-owned tree identity/path abstraction.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing migration handling, startup and tree-empty checks, and all command paths involving StorageZone.Emulators, ConnectionType.Emulators, and LocalEmulatorsItem. Review the focused migration tests for empty, successful, partial/retry, folder-flattening, and concurrent/deep-link cases; done means local connections use Clusters with emulatorConfiguration and the legacy tree and obsolete Emulator-zone branches are removed or explicitly bounded.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
databases, devtools
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.