feat: sobject refresh performance and progress indicator W-21240055#6925
Merged
feat: sobject refresh performance and progress indicator W-21240055#6925
Conversation
- Strip all file I/O from salesforcedx-sobjects-faux-generator, making it
a pure transformation library (generateFauxClassText, generateTypeText,
generateSObjectDefinition, getMinNames, getMinObjects)
- Delete soqlMetadataGenerator.ts and sobjectTransformer.ts
- Add MetadataDescribeService.listSObjects() (global describe) and
describeCustomObjects() (composite/batch API, 25 per batch, Effect Stream)
to salesforcedx-vscode-services
- Add sobjectArtifactWriter.ts to salesforcedx-vscode-core: writes all
SObject artifacts (.cls, .d.ts, .json) via FsService with
Stream.mapEffect({ concurrency: 50 }), replacing uncontrolled Promise.all
- Update refreshSObjects.ts to orchestrate fetch via MetadataDescribeService
and delegate all file writing to sobjectArtifactWriter
- Update org-browser to call describeCustomObjects([name]) replacing
describeCustomObject
Co-authored-by: Cursor <cursoragent@cursor.com>
Move listSObjects and describeCustomObjects into one shared Effect.provide(mergedLayer) so both calls reuse the same MetadataDescribeService instance and connection. Also parallelise dir resets with listSObjects to eliminate a sequential wait. Co-authored-by: Cursor <cursoragent@cursor.com>
Set BATCH_CONCURRENCY=15 for composite/batch describe calls. Empirical testing showed 15 concurrent batches paces the write pipeline evenly, completing writes just ~1.1s after the last describe vs a 12.6s drain tail with unbounded concurrency (14s → 13.3s phase-3 time). Also confirmed WRITE_CONCURRENCY=50 is optimal; higher values add fiber overhead without benefit since transformation work is CPU-bound. Co-authored-by: Cursor <cursoragent@cursor.com>
Aligns method name with the existing writeFile convention. Co-authored-by: Cursor <cursoragent@cursor.com>
Collapses @salesforce/salesforcedx-sobjects-faux-generator functionality into salesforcedx-vscode-metadata and removes the faux-generator package. Refresh SObjects command now lives in metadata, core delegates via executeCommand. Shared SObject types and toMinimalSObject moved to salesforcedx-utils-vscode. SOQL updated to source types from utils-vscode. Work item: W-21240055 Co-authored-by: Cursor <cursoragent@cursor.com>
…s layer - Add TransmogrifierService with Effect Schema-backed SObject types (SObjectSchema, SObjectFieldSchema, ChildRelationshipSchema, PicklistValueSchema) and toMinimalSObject / decodeSObject methods - Add queryable field to SObjectGlobalDescribeItem and listSObjects mapping - Add Cache.makeWith for listSObjects (30-min TTL, keyed by orgId) and describeCustomObject (capacity 500, 30-min TTL, keyed by orgId:objectName) - Replace metadata's local SObject types and toMinimalSObject with imports from salesforcedx-vscode-services via TransmogrifierService - Replace SOQL's JsforceOrgDataSource with ServicesOrgDataSource backed by MetadataDescribeService + TransmogrifierService - Fix FileSystemOrgDataSource.retrieveSObject to check both standard and custom object directories and use validated JSON parsing via decodeSObject - Wire SOQL extension to salesforcedx-vscode-services (extensionDependency, tsconfig reference, wireit dep, @salesforce/effect-ext-utils dep) W-21240055 Co-authored-by: Cursor <cursoragent@cursor.com>
- Keep rollup migration for salesforcedx-vscode-soql (develop) - Keep salesforcedx-vscode-services devDep/extension dep added by our branch - Keep salesforcedx-vscode-metadata in expanded extensionDependencies alongside salesforcedx-vscode-media (develop) - Add effect-ext-utils tsconfig reference to core (develop) - Drop salesforcedx-sobjects-faux-generator references (deleted in our branch) - Pin effect to ^3.19.14 in core (develop) Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
- Add ProjectService.getSObjectPaths() returning fully-formed .sfdx/tools paths for soql metadata and faux class directories; path constants stay private to services
- Rewrite FileSystemOrgDataSource to use ProjectService.getSObjectPaths() via getServicesApi, dropping raw constant and projectPaths imports from salesforcedx-utils-vscode; also fixes a bug where readDirectory results were incorrectly mapped with entry[0] (first char of filename)
- Remove improper `export type { SObjectField, SObject }` re-export from orgMetadata.ts
- Update codeCompletion.ts to import SObject/SObjectField directly from salesforcedx-vscode-services via import type
W-21240055
Co-authored-by: Cursor <cursoragent@cursor.com>
…jectService Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…nored) Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…-only v7 Reverts the strip-ansi pin/override from package.json and restores package-lock.json to origin/develop. The static ESM import broke when @vscode/test-electron pulled ora@8 which depends on strip-ansi@7 (ESM-only), causing it to be hoisted above LWC's declared ^5.2.0 on fresh npm install. Using require() makes the import format-agnostic and resilient to hoisting. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…rt ts-jest issue Co-authored-by: Cursor <cursoragent@cursor.com>
…tement Co-authored-by: Cursor <cursoragent@cursor.com>
… and soql - Add getTypingsPath() to ProjectService (W-21240055) - Replace buildDirs() + local path constants in sobjectArtifactWriter.ts with ProjectService path methods; remove SOBJECTS_DIR/SOQLMETADATA_DIR from metadata constants.ts - Replace readDirectory/readFile from salesforcedx-utils-vscode in SOQL orgMetadata.ts with FsService (vscode.workspace.fs backed, web-compatible) Co-authored-by: Cursor <cursoragent@cursor.com>
Remove sobjects.ts and its re-exports from salesforcedx-utils-vscode added accidentally during the SObject refresh migration. The goal was to break deps TO vscode-utils, not add to it. These artifacts were dead code — nothing in the codebase imports them. W-21240055 Co-authored-by: Cursor <cursoragent@cursor.com>
… non-Effect consumers Move SObjectRefreshEventService emitter fully inside Effect lifecycle; extract a pre-bound onRefreshComplete callback at activation time and expose it as subscribeToSObjectRefresh on the API surface. CommandEventDispatcher in core consumes this plain function instead of the Effect accessor, eliminating the module-level emitter and keeping the emitter owned entirely by the Effect runtime. Made-with: Cursor
…rship to CommandEventDispatcher Remove speculative SObjectRefreshEventService from services (no current Effect consumers). CommandEventDispatcher in core directly registers and handles the command, keeping services API surface as pure typeof ServiceClass. GPT continues to consume the plain JS onRefreshSObjectsCommandCompletion API unchanged. Made-with: Cursor
…eturn value Made-with: Cursor
peternhale
approved these changes
Mar 3, 2026
Contributor
There was a problem hiding this comment.
I think this should be 1, like listSObjectsCache
Contributor
Author
There was a problem hiding this comment.
so any orgId change will force a total do-oever? Seems right
Comment on lines
271
to
274
Contributor
There was a problem hiding this comment.
Suggested change
| const [type, folder, ...theRest] = key.split(':'); | |
| return performListMetadata(orgId, type, folder); |
- Remove launch configs and sourceMapPathOverrides from .vscode/launch.json - Remove package entry from package-lock.json - Delete remaining faux-generator src and test files Made-with: Cursor
…ate CI Made-with: Cursor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


What does this PR do?
caching works, but with a lot less boilerplate for services dependency layers
(only provide the non-extensions-specific ones, get the "globals" from buildContext
@W-21240055@