Skip to content

Features from release 0.8.0 #573

Merged
tnaum-ms merged 565 commits intonextfrom
rel/release_0.8.0
Apr 24, 2026
Merged

Features from release 0.8.0 #573
tnaum-ms merged 565 commits intonextfrom
rel/release_0.8.0

Conversation

@tnaum-ms
Copy link
Copy Markdown
Collaborator

@tnaum-ms tnaum-ms commented Apr 13, 2026

Release 0.8.0

This PR collects all features and fixes for version 0.8.0 of the DocumentDB for VS Code extension.

The headline feature is full shell integration — a suite of interconnected surfaces for querying DocumentDB: enhanced Collection View autocompletion, a new Query Playground file format, and an Interactive Shell REPL, all sharing a common schema cache and operator knowledge base.


🆕 New Features

Schema Analyzer Package (@vscode-documentdb/schema-analyzer)

PRs: #506, #508

  • Standalone npm workspace package for schema analysis with support for 24 BSON types
  • Class-based API (addDocument/getSchema) with version-based caching and trace logging
  • Schema transformers: generateDescriptions, toTypeScriptDefinition, toFieldCompletionItems
  • Enhanced FieldEntry with bsonType, bsonTypes, isOptional, arrayItemBsonType

DocumentDB Constants Package (@vscode-documentdb/documentdb-constants)

PR: #513

  • 308 operator entries (query, aggregation, update, window) with metadata and documentation links
  • Web scraper for generating operator data from official docs
  • Idempotent registry with override system and cross-category fallback logic

Collection View — Context-Aware Autocompletion

PRs: #518, #530, #532

  • New documentdb-query custom Monaco language for filter, project, and sort editors
  • Context-sensitive completion filtering based on cursor position (key vs. value, operator vs. field)
  • Type-aware operator ordering based on field BSON types from the schema analyzer
  • Relaxed query syntax: unquoted keys, BSON constructors (ObjectId(), ISODate()), JavaScript expressions
  • Hover documentation for all operators with links to DocumentDB API docs
  • Syntax validation with near-miss typo warnings ("Did you mean ObjectId?")
  • Project (1/0) and sort (1/-1) value completions
  • JavaScript global completions (Date, Math, RegExp)

Legacy Scrapbook Removal

PR: #533

  • Removed the entire ANTLR grammar, Language Server, and external mongosh child process
  • Cleaned up all associated commands, settings, and dependencies

Query Playground (.documentdb.js file format)

PRs: #536, #538, #540, #543, #551, #553, #559, #560

  • New .documentdb.js file type for writing and executing DocumentDB API queries with JavaScript syntax
  • CodeLens-driven execution: Run All, Run Selection, Run Current Block (Ctrl+Enter / Ctrl+Shift+Enter)
  • Persistent worker thread per session with isolated MongoClient — infinite-loop safe with cancel support
  • Formatted result display in a dedicated side panel with DocumentDB icon and JSONC syntax highlighting
  • console.log(), print(), and printjson() output captured in a dedicated output channel
  • TypeScript IntelliSense via a TS Server Plugin: db.* method chains, cursor methods, BSON types, hover docs
  • Schema-driven field completions for query operators inside .documentdb.js files
  • Shared SchemaStore singleton for cross-surface schema sharing
  • Sequential numbering for new playground files
  • Confirmation dialog for Run All
  • OS-aware modifier key display in templates and CodeLens

Interactive Shell

PRs: #508 (step 8), #561, #576, #580, #591

  • Full REPL experience inside a VS Code terminal (Pseudoterminal) — no external mongosh required
  • Shell commands: show dbs, show collections, use <db>, it, help, exit/quit, cls/clear
  • Persistent eval context: variables survive across commands within a session
  • Command history navigation (Up/Down), line editing with cursor movement and word navigation
  • Multi-line input support with continuation prompt (⋯ >) for incomplete expressions (fix: multi-line support in the interactive shell #591)
  • Tab completion with 7 context types, inline ghost-text suggestions, color-coded completion lists (Add context-aware shell completion and inline suggestions #576)
  • Real-time syntax highlighting via vendored Monarch tokenizer + ANSI colorizer (Enhancement: Interactive Shell with Syntax Highlighting #580)
  • ANSI-colored JSON output (configurable via documentDB.shell.display.colorSupport)
  • Dynamic prompt and terminal tab name showing current database (DocumentDB: user@cluster/db)
  • Clickable action lines after query results (text labels with prefix)
  • Launch from right-click on cluster, database, or collection nodes

Multi-Connection Playgrounds

PR: #583

  • Per-document connection isolation: PlaygroundService stores connections per URI
  • Per-cluster worker pool instead of singleton worker
  • CodeLens shows active connection info per document
  • URI migration when saving untitled → file (connection follows the document)

Cross-Feature Linking (Collection View ↔ Playground ↔ Shell)

PR: #589

  • Collection View toolbar buttons to open Playground and Shell with current query
  • Shell action lines link to Playground for the executed query
  • Playground CodeLens links to Collection View and Shell
  • Copy/Paste query buttons in Collection View toolbar
  • skip/limit preserved across all cross-feature query transfers
  • Auto-execute initial query when navigating to Collection View
  • Overflow toolbar support for secondary actions (Link Collection View, Query Playground, and the Interactive Shell #589 + direct commits)

Telemetry Instrumentation

PRs: #599, #601

  • Shell lifecycle telemetry: session start/end, per-command evaluation, command classification
  • Playground execution analytics: run mode, block count, timing, worker health
  • Cross-feature navigation: activation source tracking for all surface transitions
  • Completion acceptance tracking with normalization
  • Server metadata correlation (auth type, database, worker state)
  • Standardized property conventions: boolean ternaries, numeric values as measurements

🐛 Bug Fixes

Bug Bash #1 Fixes

PR: #592

  • use/show in multi-line blocks silently drops subsequent statements → lexical scanner normalization
  • ANSI escape codes leaking into playground error messages → stripAnsi()
  • cls/clear does not clear terminal scrollback → added \x1b[3J escape
  • Removed documentDB.timeout IPC-level timeout entirely; users use .maxTimeMS() + Cancel/Ctrl+C

Playground Fixes

PR: #584, #590, direct commits

  • Fix extra newline in print() output (Fix extra newline in playground print() output #584)
  • Cancel snippet tab stops on delimiter chars in query playground (Fix: cancel snippet tab stops on delimiter chars in query playground #590)
  • Surface uncaught worker exceptions to user
  • Reject pending requests on worker error event
  • Surface timeout settings hint in playground result panel
  • Skip executing workers in shutdownOrphanedEvaluators
  • Use documentUri instead of activeTextEditor for result routing
  • Migrate playground connection on untitled→file save
  • Remove cluster node from "New Query Playground" menu
  • Remove playground command from database-level inline menu
  • Gate navigation CodeLens to blocks containing code only

Shell Fixes (direct commits)

  • Reset _lastCursorRow on terminal resize
  • Enhance cursor movement handling and line wrapping logic
  • Filter whitespace-only lines in multi-line paste
  • Multi-line paste handling with user prompt options and VS Code built-in warning settings
  • Closing bracket suggestion: avoid false positives during input
  • Handle leading quotes in insertText for common prefix calculation

Security Fixes

  • CodeQL: improve escaping of backslashes and single quotes in collection names
  • Escape collection names in JS string interpolation (C2/C3/C4)
  • Add error feedback for paste failures and reject unsupported input (C5)

Other Fixes

  • Set default values for configuration settings in dialogs and connection utilities
  • Thread clusterDisplayName and viewId through navigation context
  • Unify context menu grouping for shell and playground across all tree levels

🔧 Configuration Changes

Old Setting New Setting Reason
documentDB.shell.batchSize documentDB.batchSize Shared by all surfaces
documentDB.shell.timeout documentDB.timeout Shared by all surfaces (later removed in #592)
documentDB.shell.display.colorOutput documentDB.shell.display.colorSupport Clarity

🏗️ Chore / Infrastructure

CI/CD & Workflow

  • Enhanced GitHub Actions main workflow with automated code quality reports as PR comments
  • Granular status reporting for localization, lint, and formatting checks
  • New workflow for build size cache seeding and verification

Documentation & Copilot Instructions

  • Added "Git Safety" section to copilot instructions (prohibit git add -f)
  • Terminology guidelines: DocumentDB vs. MongoDB API usage
  • TDD contract test handling instructions
  • FluentUI React v9 skill documentation with overflow patterns
  • Telemetry instrumentation skill (SKILL.md) with common mistake patterns

Compliance

  • Updated CredScanSuppressions.json for moved test file paths

Refactoring

  • Centralized shell command IDs for improved maintainability
  • Renamed playground commands for consistency and clarity
  • shell-runtime extraction into shared @microsoft/documentdb-vscode-shell-runtime package

📋 PR & Commit Reference

PRs merged into rel/release_0.8.0 (post-#508)

PR Title
#576 Add context-aware shell completion and inline suggestions
#580 Enhancement: Interactive Shell with Syntax Highlighting
#583 Multi-connection playgrounds with per-document isolation
#584 Fix extra newline in playground print() output
#589 Link Collection View, Query Playground, and the Interactive Shell
#590 Fix: cancel snippet tab stops on delimiter chars in query playground
#591 fix: multi-line support in the interactive shell
#592 Bug Bash #1: Fix block execution, ANSI errors, cls scrollback, remove IPC timeout
#599 fix: standardize telemetry property conventions
#601 Add telemetry for Interactive Shell, Query Playground, and cross-feature navigation

Umbrella PR #508 (Feature: Interactive Shell) — composed of:

PR Title
#506 refactor: SchemaAnalyzer class + enhanced FieldEntry + new schema transformers
#513 feat: add documentdb-constants package — operator metadata for autocomplete
#518 feat: documentdb-query language — CompletionItemProvider, HoverProvider, acorn validation
#530 feat: context-sensitive completions — cursor-aware filtering & type suggestions
#532 feat: collection view & autocompletion UX improvements (Step 4.6)
#533 Step 5: Legacy Scrapbook Removal
#536 Step 6: DocumentDB Scratchpad — File type, CodeLens, execution engine
#538 feat: Shared Schema Cache (SchemaStore) — Step 6.1
#540 feat: persistent worker thread for scratchpad execution (Step 6.2)
#543 Step 7: Scratchpad IntelliSense — Shell API types, TS Plugin, CompletionItemProvider
#551 refactor: Step 7.1 — migrate shared completion logic to query-language/
#553 Step 7.1.5 — Query Playground Name Unification
#559 feat: Query Playground console logging & improved result display
#560 Step 7.2: Pre-Shell Critical Items
#561 Step 8: Interactive Shell — Complete

tnaum-ms and others added 26 commits April 11, 2026 13:59
Add informational messages when:
- Playground file is empty (runAll)
- No code to run / no code block at cursor (runSelected)
- No database connection (executePlaygroundCode)
- A playground is already running (executePlaygroundCode)

Previously these cases returned silently with no feedback.
Add initialization promise lock so concurrent evaluate() calls during
initialization await the same promise instead of spawning duplicate workers.
Wrap evaluateFresh() body in try/finally to call instanceState.close()
after each evaluation. Prevents leaking ShellInstanceState, ShellEvaluator,
and vm.Context resources on every playground run.
Add assertDocumentObject() guard after parseShellBSON() for projection
and sort parameters. Rejects scalars, arrays, and null with a clear
QueryError instead of passing invalid values to the driver.
…rs (M5, M7, M8)

M5: Replace toLocaleString() with toISOString() for playground filenames
    to avoid locale-dependent characters in file paths.
M7: Replace localeCompare with sensitivity:'base' with strict === equality
    for query cache keys. Prevents false cache hits (e.g., café vs cafe).
M8: Log unexpected errors during AST walk instead of silently swallowing
    all exceptions. SyntaxErrors are still suppressed as expected.
Show the human-readable clusterDisplayName when credential lookup fails
instead of the internal clusterId.
… M4)

M3: Add 300ms debounce to onDidChangeTextDocument handler in
    PlaygroundDiagnostics to avoid O(n) regex scans on every keystroke.
M4: Clear existing schema data before scanning in scanCollectionSchema()
    so users get a fresh scan result instead of accumulated stale entries.
Replace four separate nullable fields (_persistentInstanceState,
_persistentEvaluator, _persistentContext, _persistentVmContext) and
_persistentInitialized flag with a single _persistent compound object.
Eliminates partial initialization risk and removes all non-null assertions.

Also fix test mock to include close() method for C3 compatibility.
Replace space-only word delimiter with alphanumeric+underscore+dollar
pattern for word navigation. Now db.collection.find() navigates by
word boundaries (db, collection, find) instead of requiring one space
per word.
…(H4)

dropCollection/createCollection now clear the collections cache for
that database. dropDatabase/createDatabase clear the databases cache.
Prevents stale entries in autocomplete and tree views after mutations.
Add documentDB.shell.initTimeout setting (default: 60 seconds) to prevent
the shell from hanging indefinitely if worker spawn or connection fails.
Wraps ensureWorker() in Promise.race against a timeout.
- Update l10n bundle with new user-facing strings from review fixes
- Fix no-unsafe-assignment lint errors in ClustersClient parseShellBSON
- Apply prettier formatting to newPlayground.ts and runSelected.ts
L3: Replace undefined array access (lineContent[-1]) with explicit
    bounds check in registerLanguage.ts completion provider.
L4: Clamp randomSample count to array.length to avoid ineffective
    swaps when count exceeds available elements.
Consolidated review from Claude, GPT-4o, Gemini, and Copilot PR reviewer.
24 findings tracked: 15 resolved with code fixes, 4 deferred to issues
(#566, #567, #569, #570), 2 ignored, 2 investigated, 1 revisited.
TDD contracts deferred to dedicated testing iteration.
Add missing exclusion rules for directories added after the initial
.vscodeignore was written:
- api/** (separate Node.js project with own node_modules)
- docs/** (planning/analysis docs)
- packages/** (monorepo source packages, already bundled)
- dist/** (replace dist/test/** - dev-mode webpack output)
- .config/** and .devcontainer/** (dev environment config)
- work-summary.md, progress.md (dev notes)
- extension.bundle.ts, main.ts (dev entry points)

Fixes VSIX bloat from ~25 MB to expected ~5-6 MB.

Agent-Logs-Url: https://github.com/microsoft/vscode-documentdb/sessions/19fbdfe6-d2e8-4402-9238-f406db045f56

Co-authored-by: tnaum-ms <171359267+tnaum-ms@users.noreply.github.com>
Remove 3 tests that exact-matched implementation descriptions and doc
links against scraped documentation content. These broke whenever the
upstream docs changed, even when our code was correct.

Removed tests:
- 'descriptions match the dump (detect drift)'
- 'descriptions match the merged dump+overrides'
- 'doc links from dump match implementation links'

Kept all structural tests (operator presence, category mapping,
not-listed exclusion) and the override-application test that
validates overrides in operator-overrides.md are reflected in
the implementation.

Also cleaned up unused getMergedOperators helper, mergedOperators
variable, and ReferenceOperator type import.
Ensure the interactive shell tab title keeps updating after `use <db>` even when the session has no username, such as Entra ID auth.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Stop any active shell spinner during PTY shutdown so close during connect or eval does not leave background timer work behind.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@tnaum-ms tnaum-ms changed the title Release 0.8.0 Features from release 0.8.0 Apr 13, 2026
- Update l10n bundle with new localized strings from H1
  (validator diagnostic messages)
- Apply prettier formatting to modified files
- Fix lint errors in WorkerSessionManager.test.ts
  (inline type import, remove unnecessary type assertions)
@tnaum-ms
Copy link
Copy Markdown
Collaborator Author

PR #573 Review — All Issues Addressed

Summary of Changes (16 commits)

Issue Status Commit Description
C1+C2 ✅ Fixed 8bb44b8a Added typeDefs/ to shell-api-types package files
C4+C5 ✅ Fixed d80ceaca Clarified constructor signature in shell-runtime README
H1 ✅ Fixed 8a38a572 Localized 6 diagnostic messages in documentdbQueryValidator
H2 📋 Issue #603 Created tracking issue for l10n strategy
H3 ✅ Fixed 7a9123f2 TDD tests: worker crash → recovery
H4 ✅ Fixed 7a9123f2 TDD tests: multi-cluster isolation
M1 ⏭️ Skip Ignored per operator
M2 ✅ Fixed 3fbdadc8 Telemetry for SchemaStore sizes + issue #604
M3+M4 ✅ Fixed fc92e274 SilentCatchMeter for empty catch observability
M5 ✅ Fixed 2643b0fa Clear timeout in ShellSessionManager
M6 ✅ Fixed 599442b4 Prevent duplicate timers in ShellSpinner
M7 ✅ Fixed aaac43db Playground run command telemetry enrichment
M8 ✅ Fixed 5b61184c Error handling for Collection View navigation
M9 ✅ Fixed 22d2cd2f Trace logging for schema scan
M10 ✅ Fixed 762f0940 Trace logging across playground subsystems
L1 ✅ Fixed e0d2ba39 Escaped quote handling in context detector
L2 ✅ Fixed bac62fbf Template literal ${} nesting in bracket counter
L6 ✅ Fixed e9369cd1 Evaluator pool telemetry

Validation

  • ✅ All 1816 tests pass (90 test suites)
  • ✅ l10n bundle updated
  • ✅ Prettier clean
  • ✅ ESLint clean
  • ✅ Build succeeds
  • ✅ VSIX packages successfully

Add beforeAll() hooks with the standard TDD contract warning message
to both 'TDD: Worker Crash Recovery' and 'TDD: Multi-Cluster Evaluator
Isolation' test suites, matching the convention used by other TDD tests
in the codebase (e.g., playgroundContextDetector.test.ts).
Add activeShellSessionCount measurement to shell.sessionStart
telemetry event. This parallels the activeEvaluatorCount measurement
added for playground evaluators and enables measuring concurrent
shell session usage patterns.
Prevent telemetry bursts when a catch location fires rapidly.
If a flush is triggered within 30 seconds of the last flush,
the hit threshold is doubled instead of flushing immediately.
This allows catches to accumulate during bursts while still
capturing data periodically.

The force-flush method (for dispose paths) is preserved unchanged.
Add SilentCatchMeter.hit() to interesting empty catch locations:
- ClustersClient.ts: listSearchIndexes feature detection failure
- ShellOutputFormatter.ts: EJSON/JSON stringify fallbacks
- mongoConnectionStrings.ts: database name extraction and
  connection string modification failures
- PlaygroundEvaluator.ts: EJSON/JSON deserialize fallbacks

These are extension-side catches where silent failures could hide
real issues. The meter aggregates counts and flushes to telemetry
with 30s throttling to avoid telemetry bursts.
ShellSessionManager.initialize() had a redundant outer Promise.race
timeout that shadowed the inner timeout in WorkerSessionManager.
The outer timeout used the user-configured documentDB.shell.initTimeout
setting, but ensureWorker() defaulted to a hardcoded 30s.

A user who raised the setting to 90s (e.g., for slow VPN) would still
get a 30s failure from the inner path, with a SettingsHintError telling
them to raise the very setting they already raised.

Fix: pass the configured timeout directly to ensureWorker() and remove
the outer Promise.race. WorkerSessionManager.sendRequest() already
produces the correct SettingsHintError with the settings key hint.

This also eliminates the M5 timer leak (the outer setTimeout that was
never cleared on success in the original code, fixed in 2643b0f but
now removed entirely).

Addresses review issue N1 on PR #573.
@tnaum-ms
Copy link
Copy Markdown
Collaborator Author

N1: ShellSessionManager shadows user-configurable init timeout

Fixed in commit 72c8739d.

Removed the redundant outer Promise.race timeout from ShellSessionManager.initialize() and passed the user-configured documentDB.shell.initTimeout directly to ensureWorker(). Previously, the outer timeout used the setting but ensureWorker() defaulted to a hardcoded 30s — so users who raised the timeout to 90s for slow VPN connections still got a 30s failure.

WorkerSessionManager.sendRequest() already produces the correct SettingsHintError with the settings key, so the user experience is preserved. This also eliminates the M5 timer leak entirely (the outer setTimeout is gone).

terminateWorker() always set _terminatingIntentionally=true before
reading it, so the 'reason' telemetry property was always 'intentional'.
killWorker() (timeout/cancel) was indistinguishable from shutdown()/
dispose() in telemetry.

Fix: accept reason as a parameter ('intentional' | 'forced').
killWorker() passes 'forced', all other callers pass 'intentional'.

Addresses review issue N2 on PR #573.
@tnaum-ms
Copy link
Copy Markdown
Collaborator Author

N2: terminateWorker telemetry always reported 'intentional'

Fixed in commit 6c5ed89b.

terminateWorker() always set _terminatingIntentionally = true before reading it, so the reason property in worker.terminated telemetry was always 'intentional'. killWorker() (timeout/cancel) was indistinguishable from shutdown()/dispose().

Fix: terminateWorker() now accepts an explicit reason parameter. killWorker() passes 'forced', all other callers pass 'intentional'.

Create TelemetryAccumulator utility that sends the first N events
individually (so dashboards see feature activity immediately), then
switches to batch mode — accumulating counts by dimension key and
flushing periodically (every 20 hits, 30s minimum interval).

Apply to completionAccepted handlers in both the playground command
(ClustersExtension.ts) and the Collection View tRPC procedure
(collectionViewRouter.ts). Suppress the per-call telemetry from the
framework wrappers and route through the accumulator instead.

This reduces telemetry volume from O(completions/minute) to O(1)
per 30s window while preserving category×source breakdown data.

Addresses review issue N3 on PR #573.
@tnaum-ms
Copy link
Copy Markdown
Collaborator Author

N3: completionAccepted telemetry volume regression

Fixed in commit 1a4b6ea5.

Created TelemetryAccumulator utility — sends the first 5 events individually (so dashboards light up immediately), then switches to batch mode accumulating counts by category|source dimension key, flushing every 20 hits with a 30s minimum interval.

Applied to both completion accepted handlers:

  • Playground command (ClustersExtension.ts) — suppresses per-call registerCommand telemetry
  • Collection View tRPC procedure (collectionViewRouter.ts) — suppresses per-call tRPC telemetry

Reduces volume from O(completions/minute) to O(1) per 30s window while preserving category×source breakdown.

A whitespace-only filter string (e.g., '   ') would pass through the
falsy check and produce 'db.getCollection("c").find(   )' — valid JS
but surprising when debugging. Use filter.trim() || '{}' instead.

Addresses review issue N4 on PR #573.
@tnaum-ms
Copy link
Copy Markdown
Collaborator Author

N4: Whitespace-only filter in buildFindExpression

Fixed in commit deab17f1.

Changed filter || '{}' to filter.trim() || '{}' so whitespace-only filter strings produce find({}) instead of find( ).

blockContainsCode() treated lines like '/* label */ db.find()' as
comment-only because the startsWith('/*') + includes('*/') branch
used 'continue' without checking if code follows after '*/'.

Now inspects the substring after '*/' and returns true if non-empty
non-comment tokens follow. Also handles the inBlockComment state
transition correctly when '*/' appears mid-line.

Addresses review issue N5 on PR #573.
@tnaum-ms
Copy link
Copy Markdown
Collaborator Author

N5: blockContainsCode treats inline block comments as comment-only

Fixed in commit ef89347b.

Lines like /* label */ db.find() were treated as comment-only because the startsWith('/*') + includes('*/') branch skipped the line without checking for code after */. Now inspects the substring after */ and returns true if non-empty non-comment tokens follow.

If the dynamic import in doRegisterLanguage() rejects (e.g., bundler
glitch), the rejected promise was cached permanently — every subsequent
call returned the same rejection, and completions never recovered for
the life of the webview.

Clear registrationPromise in a .catch() handler to allow retry on
next call.

Addresses review issue N6 on PR #573.
@tnaum-ms
Copy link
Copy Markdown
Collaborator Author

N6: Cached rejected registration promise prevents recovery

Fixed in commit ad4769bc.

Added .catch() handler that clears registrationPromise when doRegisterLanguage() rejects, allowing the next call to retry. Previously a rejected promise was cached permanently and completions never recovered.

@tnaum-ms
Copy link
Copy Markdown
Collaborator Author

Second-pass review (N1-N6) — All Issues Addressed

Issue Status Commit Description
N1 ✅ Fixed 72c8739d Pass user-configured timeout to WorkerSessionManager (was shadowed by 30s default)
N2 ✅ Fixed 6c5ed89b terminateWorker(reason)killWorker() now passes 'forced', others 'intentional'
N3 ✅ Fixed 1a4b6ea5 TelemetryAccumulator utility + applied to both completionAccepted handlers
N4 ✅ Fixed deab17f1 `filter.trim()
N5 ✅ Fixed ef89347b Detect code after inline block comments in CodeLens
N6 ✅ Fixed ad4769bc Clear cached rejected registration promise to allow retry

All 1816 tests pass, lint/prettier clean.

SilentCatchMeter is now a thin static wrapper over a shared
TelemetryAccumulator instance configured with immediateCount: 0
(all catches are batched, never sent individually) and the same
batchSize/interval parameters (20 hits, 30s).

This eliminates the duplicated throttling logic between the two
utilities. SilentCatchMeter's public API (hit/flush) is unchanged,
so all call sites continue to work without modification.

SchemaStore._reportTelemetry is left as-is because it reports
state snapshots (high-water marks), not discrete event counts —
a fundamentally different pattern from the accumulator.
@tnaum-ms
Copy link
Copy Markdown
Collaborator Author

Refactor: SilentCatchMeter now delegates to TelemetryAccumulator

Commit 50a40e83.

SilentCatchMeter is now a thin static wrapper over a TelemetryAccumulator instance with immediateCount: 0 (all catches are batched). This eliminates the duplicated throttling logic between the two utilities. The public API (hit(key) / flush()) is unchanged — all 8 call sites work without modification.

Not migrated: SchemaStore._reportTelemetry — it reports state snapshots (high-water marks), not discrete event counts, so the accumulator pattern doesn't fit.

Replace TelemetryAccumulator class and SilentCatchMeter wrapper with a
single function-shaped API:

    callWithAccumulatingTelemetry(callbackId, callback, options?)
    flushAccumulatingTelemetry(callbackId?)
    meterSilentCatch(locationKey)

callWithAccumulatingTelemetry mirrors callWithTelemetryAndErrorHandling:
- Numeric measurements are summed across calls under the same callbackId.
- String properties are last-wins.
- Flushed event uses the exact callbackId (no '.batch' suffix).
- Errors never batch — they flow through the standard error pipeline.
- Options: { batchSize, minFlushIntervalMs }.

meterSilentCatch is a one-line helper for catch blocks. Location keys
are prefixed with 'accumulated_' to avoid collision with framework-
injected measurement names (duration, eventVersion, etc.).

Extension deactivation calls flushAccumulatingTelemetry() so the last
partial batch is not lost.

Removed:
- src/utils/silentCatchMeter.ts
- src/utils/telemetryAccumulator.ts
@github-actions
Copy link
Copy Markdown
Contributor

✅ Code Quality Checks

Check Status How to fix
Localization (l10n) ✅ Passed
ESLint ✅ Passed
Prettier formatting ✅ Passed

This comment is updated automatically on each push.

@github-actions
Copy link
Copy Markdown
Contributor

📦 Build Size Report

Metric Size
VSIX (vscode-documentdb-0.8.0-beta.vsix) 6.62 MB
Webview bundle (views.js) 5.78 MB

⚠️ No baseline cached for next yet — delta will appear after the next push to that branch.

Download artifact · updated automatically on each push.

@tnaum-ms tnaum-ms merged commit 7145781 into next Apr 24, 2026
8 checks passed
@tnaum-ms tnaum-ms deleted the rel/release_0.8.0 branch April 24, 2026 09:32
@tnaum-ms tnaum-ms added this to the 0.8.0 milestone Apr 24, 2026
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.

5 participants