microsoft / microsoft/vscode-documentdb

Enhancement: Persist playground connection metadata across reopen

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

Nobody has claimed this yet.

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

Description

Summary

Saved .documentdb.js playground files lose their connection binding when reopened (or across VS Code sessions). The PlaygroundService._connections map is in-memory only. On reopen, the file loads from disk with all content intact but shows "Not connected."

Current Behavior

The user must create a new playground from the tree panel and copy their code over. For untitled documents, once closed, they're gone entirely (VS Code behavior).

Proposed Enhancement

Persist the connection metadata (clusterId + databaseName) in workspace state or in the document's metadata, and attempt to restore it on reopen.

Context

Identified during pre-merge review of PR #583 (multi-connection playgrounds). This is a follow-up enhancement, not a blocker for the current PR.


From review issue #4 in multi-connection-playgrounds-review.md

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 PlaygroundService._connections and the reopen flow for saved .documentdb.js files. Decide whether workspace state or document metadata best preserves clusterId and databaseName, then verify that reopening a file restores its connection across VS Code sessions without losing its content.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.