Skip to content

fix: warn when JWT access token and API version < 68 cause empty metadata results @W-24046915@ - #1835

Merged
WillieRuemmele merged 11 commits into
mainfrom
wr/jwtApiVersionWarning
Sep 16, 2026
Merged

WillieRuemmele merged 11 commits into
mainfrom
wr/jwtApiVersionWarning

Conversation

@WillieRuemmele

Copy link
Copy Markdown
Member

Summary

  • Adds a proactive warning in ConnectionResolver.resolve() when the connection has a JWT-based access token and the API version is below 68.0
  • SOAP metadata operations (via jsforce) throw when JWT + API < 68, but the existing catch block silently swallows errors and returns empty arrays — producing a near-empty manifest with no feedback
  • The warning tells users exactly what's wrong and how to fix it (--api-version 68 or update sourceApiVersion)

Work Item

@W-24046915@: [JWTBAT] Metadata API listMetadata returns incomplete results with JWT-based access tokens when connection API version is below 68

Proof of Work

  • Tests: 20 passing (17 existing + 3 new)
  • Lint: clean
  • Build: clean
  • Real org verification: warning fires at v64 (0 components), no warning at v68 (516 components)

Test plan

  • Verify warning appears when running project generate manifest --from-org against an org with JWT tokens and sourceApiVersion < 68
  • Verify no warning when using --api-version 68
  • Verify no warning against orgs with non-JWT tokens
  • Verify existing metadata listing behavior is unchanged (warning only, no functional change)

…4124120@

Use lstatSync instead of statSync to reject symlinked content directories
from partial-delete processing. Filter out symlinks within content directories
before deletion. Add defense-in-depth symlink check in deleteFilePath.
Extract findSymlinkOnPath to shared fileSystemHandler utility and add
symlink traversal protection to StandardWriter._write() — covers both
the write and delete paths for all metadata types during retrieve.
Resolves conflicts in streams.ts (combined symlink + path traversal
imports), streams.test.ts (kept both symlink and path traversal tests),
and eslint-suppressions.json (combined _write dangle counts).
The delete path only checked the leaf segment for symlinks, so a
symlinked ancestor directory (e.g. digitalExperiences/ → external)
could let rmSync delete files outside the project before the write-path
guard fired.

- Add findSymlinkOnPathSync to walk all segments from package root
- Use it in the pre-filter (before FileResponse creation) and as
  defense-in-depth in deleteFilePath
- Guard both findSymlinkOnPath variants against destinations that
  resolve outside the root (.. traversal)
- Remove now-dead isSymlinkSync helper
Exercises the exact gap Eric identified: a DEB project where
digitalExperiences/ is a symlink to an external directory. Verifies
findSymlinkOnPathSync catches the ancestor symlink and the external
file survives.
…data results @W-24046915@

SOAP metadata operations silently fail when an org uses JWT-based access
tokens and the API version is below 68.0. The ConnectionResolver catch
block swallows these errors at debug level, producing a near-empty
manifest with no user feedback. This adds a proactive warning before
enumeration begins, telling users exactly what's wrong and how to fix it.
@WillieRuemmele
WillieRuemmele requested a review from a team as a code owner September 15, 2026 15:28
…data results @W-24046915@

SOAP metadata operations silently fail when an org uses JWT-based access
tokens and the API version is below 68.0. The ConnectionResolver catch
block swallows these errors at debug level, producing a near-empty
manifest with no user feedback. This adds a proactive warning before
enumeration begins, telling users exactly what's wrong and how to fix it.
@WillieRuemmele

WillieRuemmele commented Sep 16, 2026 •

Copy link
Copy Markdown
Member Author

QA Notes


Verified with Jamie on a call, here's command output

➜  dreamhouse-lwc git:(main)  hub:(DevHub) scratch:(test-iny2rphjexuu@example.com) ➜  pd project generate manifest --from-org test-iny2rphjexuu@example.com
successfully wrote package.xml
Warning: This org uses JWT-based access tokens, which require API version 68.0 or later for SOAP metadata operations. The current API version is 60.0, so metadata listing may return empty or incomplete results. To resolve, use --api-version 68 or update sourceApiVersion in sfdx-project.json.

^^ org with JWT AT, warning shown
➜  dreamhouse-lwc git:(main) ✗  hub:(DevHub) scratch:(test-iny2rphjexuu@example.com) ➜  pd project generate manifest --from-org test-iny2rphjexuu@example.com --api-version 68.0
successfully wrote package.xml

^^ api version >= 68.0, no warning
➜  dreamhouse-lwc git:(main) ✗  hub:(DevHub) scratch:(test-iny2rphjexuu@example.com) ➜  vim sfdx-project.json

^^ updated sfdx-project.json sourceApiVersion field to 68.0
➜  dreamhouse-lwc git:(main) ✗  hub:(DevHub) scratch:(test-iny2rphjexuu@example.com) ➜  pd project generate manifest --from-org test-iny2rphjexuu@example.com                   
successfully wrote package.xml
^^ command, without flag, no warning

@WillieRuemmele
WillieRuemmele merged commit 524165c into main Sep 16, 2026
49 checks passed
@WillieRuemmele
WillieRuemmele deleted the wr/jwtApiVersionWarning branch September 16, 2026 20:12
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