Skip to content

feat: sobject refresh performance and progress indicator W-21240055#6925

Merged
mshanemc merged 56 commits intodevelopfrom
sm/feedback-3
Mar 6, 2026
Merged

feat: sobject refresh performance and progress indicator W-21240055#6925
mshanemc merged 56 commits intodevelopfrom
sm/feedback-3

Conversation

@mshanemc
Copy link
Contributor

@mshanemc mshanemc commented Mar 3, 2026

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@

peternhale and others added 30 commits February 24, 2026 11:00
- 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
@mshanemc mshanemc requested a review from a team as a code owner March 3, 2026 03:48
@mshanemc mshanemc requested a review from RitamAgrawal March 3, 2026 03:48
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should be 1, like listSObjectsCache

Copy link
Contributor Author

Choose a reason for hiding this comment

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

so any orgId change will force a total do-oever? Seems right

Comment on lines 271 to 274
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const [type, folder, ...theRest] = key.split(':');
return performListMetadata(orgId, type, folder);

@peternhale peternhale changed the base branch from phale/w-21240055-feedback-feedback to develop March 3, 2026 20:13
- 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
@mshanemc mshanemc changed the title Sm/feedback 3 feat: sobject refresh performance and progress indicator W-21240055 Mar 3, 2026
Copy link
Contributor

@daphne-sfdc daphne-sfdc left a comment

Choose a reason for hiding this comment

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

SFDX: Execute SOQL Query... ✅
SFDX: Execute SOQL Query With Currently Selected Text ✅
SFDX: Create Query in SOQL Builder ✅
SOQL Builder works ✅

Image Image

@mshanemc mshanemc merged commit 3b07304 into develop Mar 6, 2026
65 of 72 checks passed
@mshanemc mshanemc deleted the sm/feedback-3 branch March 6, 2026 05:45
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.

3 participants