[BUG]: NavigationMenu SourceMember name mismatch prevents source-tracked retrieve from completing
还没有人认领这个 Issue。
评估
调研方向
Reproduce the mismatch with the listed sf project retrieve preview and start commands, using the NavigationMenu path under community/main/default and the SourceMember Tooling API query. Trace how NavigationMenu:Default_Navigation is matched to the Metadata API fullName, then verify that retrieval updates the existing file and clears the component from the next retrieve preview.
由索引模型根据 Issue 内容生成。
描述
Before You Submit
- I'm using the latest version of Salesforce CLI
- I've searched the existing issues
- I've run
sf doctorto diagnose common issues
Related Issue
https://github.com/forcedotcom/cli/issues/2781
Command
sf project retrieve start --target-org
Org Type
Scratch Org
Did this work before?
Not sure
Last Working Version
No response
Summary
Source tracking reports an Experience Cloud NavigationMenu under the SourceMember name Default_Navigation, while Metadata API returns the same component as SFDC_Default_Navigation_Complaint_Public.
Because these names do not match, sf project retrieve start cannot associate the remote SourceMember change with the existing local component.
The component already exists in a configured non-default package directory:
community/main/default/navigationMenus/SFDC_Default_Navigation_Complaint_Public.navigationMenu-meta.xml
After changing the navigation menu in Experience Builder, sf project retrieve preview reports NavigationMenu:Default_Navigation with no path or projectRelativePath.
On CLI 2.152.14, sf project retrieve start successfully retrieves SFDC_Default_Navigation_Complaint_Public from Metadata API, but writes no files ("files": []) and does not clear the source-tracked change. The same Default_Navigation change therefore appears on every subsequent retrieve preview.
Repository to Reproduce
No response
Steps to reproduce
-
Create or use a source-tracked scratch org containing an Experience Cloud site with a NavigationMenu.
-
Store the NavigationMenu in a configured non-default package directory. For example:
community/main/default/navigationMenus/SFDC_Default_Navigation_Complaint_Public.navigationMenu-meta.xmlforce-appis the default package directory. -
Reset source tracking:
sf project reset tracking --target-org <scratch-org-alias> -
Verify both source-tracking previews show no changes:
sf project retrieve preview --target-org <scratch-org-alias> --jsonsf project deploy preview --target-org <scratch-org-alias> --json -
Modify the NavigationMenu in Experience Builder. For example, change the label of one menu item.
-
Run:
sf project retrieve preview --target-org <scratch-org-alias> --jsonThe CLI reports the changed component as
NavigationMenu:Default_Navigation, with nopathorprojectRelativePath. -
Run:
sf project retrieve start --target-org <scratch-org-alias> --jsonMetadata API successfully returns the component with the fullName
SFDC_Default_Navigation_Complaint_Public, but the command returns"files": []. -
Run retrieve preview again:
sf project retrieve preview --target-org <scratch-org-alias> --jsonNavigationMenu:Default_Navigationis still listed intoRetrieve. -
The naming mismatch can also be confirmed through the Tooling API:
sf data query --use-tooling-api --target-org <scratch-org-alias> --query "SELECT Id, MemberType, MemberName, RevisionCounter, IsNameObsolete FROM SourceMember WHERE MemberType = 'NavigationMenu'"The SourceMember has
MemberName = Default_Navigation, while Metadata API identifies the component asSFDC_Default_Navigation_Complaint_Public.
Expected Result
sf project retrieve start should associate the changed NavigationMenu SourceMember with the existing local NavigationMenu component, retrieve the change into its existing package directory, and update source tracking so the component no longer appears in sf project retrieve preview.
The SourceMember name used for source tracking and the NavigationMenu fullName returned by Metadata API should be reconciled correctly.
Actual Result
Source tracking identifies the changed component as:
NavigationMenu:Default_Navigation
Metadata API identifies and successfully retrieves the component as:
NavigationMenu:SFDC_Default_Navigation_Complaint_Public
The CLI does not associate these identities.
On CLI 2.152.14, the retrieve succeeds at the Metadata API level but returns "files": []. The existing file is not updated and source tracking is not advanced. NavigationMenu:Default_Navigation therefore remains in toRetrieve after the retrieve completes successfully.
On CLI 2.150.6, the behavior was more severe: the retrieve created a duplicate SFDC_Default_Navigation_Complaint_Public.navigationMenu-meta.xml in the default force-app package directory even though the same component already existed under community.
CLI 2.152.14 no longer reproduces the duplicate-file behavior, but the underlying SourceMember/fullName mismatch and inability to complete the source-tracked retrieve remain.
System Information
{
"architecture": "win32-x64",
"cliVersion": "@salesforce/cli/2.152.14",
"nodeVersion": "node-v22.17.1",
"osVersion": "Windows_NT 10.0.26100",
"rootPath": "C:\\Users\\dalden\\AppData\\Roaming\\npm\\node_modules\\@salesforce\\cli",
"shell": "powershell",
"pluginVersions": [
"@oclif/plugin-autocomplete 4.0.1 (core)",
"@oclif/plugin-commands 5.0.0 (core)",
"@oclif/plugin-help 7.0.0 (core)",
"@oclif/plugin-not-found 4.0.0 (core)",
"@oclif/plugin-plugins 7.0.1 (core)",
"@oclif/plugin-search 2.0.0 (core)",
"@oclif/plugin-update 5.0.0 (core)",
"@oclif/plugin-version 3.0.1 (core)",
"@oclif/plugin-warn-if-update-available 4.0.0 (core)",
"@oclif/plugin-which 4.0.0 (core)",
"@salesforce/cli 2.152.14 (core)",
"agent 2.2.2 (core)",
"apex 4.2.0 (core)",
"api 2.0.10 (core)",
"auth 5.0.7 (core)",
"code-analyzer 5.16.0 (user)",
"community 3.3.57 (user)",
"data 5.1.8 (core)",
"deploy-retrieve 4.2.2 (core)",
"info 4.0.10 (core)",
"limits 4.0.5 (core)",
"marketplace 2.0.6 (core)",
"org 6.0.13 (core)",
"packaging 3.0.7 (core)",
"schema 4.0.7 (core)",
"settings 3.0.7 (core)",
"signups 2.6.66 (user)",
"sobject 2.0.6 (core)",
"source 3.5.21 (user)",
"telemetry 4.1.0 (core)",
"templates 57.3.0 (core)",
"trust 4.0.12 (core)",
"user 5.0.4 (core)"
]
}
Additional Information
Tooling API confirms that this is not merely a local CLI naming artifact. Salesforce reports the SourceMember as:
- MemberType:
NavigationMenu - MemberName:
Default_Navigation
Metadata API reports the corresponding NavigationMenu as:
- Type:
NavigationMenu - fullName:
SFDC_Default_Navigation_Complaint_Public
The local source-tracking state likewise records the remote member as NavigationMenu__Default_Navigation.
As a control test, an ApexClass stored in the same non-default community package directory was modified in the scratch org. sf project retrieve preview correctly resolved that component to its existing community/... path. This suggests the issue is specific to NavigationMenu identity resolution rather than general handling of non-default package directories.
Resetting source tracking produces a clean baseline, but the issue immediately returns after the next NavigationMenu modification.
.forceignore patterns targeting both Default_Navigation.navigationMenu and the actual SFDC_Default_Navigation_Complaint_Public.navigationMenu-meta.xml path did not prevent the SourceMember change from appearing.
There is also historical evidence of Default_Navigation naming behavior in #772, although that issue concerns .forceignore rather than this source-tracking identity mismatch.
Screenshots or Log Files
No response
- 主要语言
- 没有语言数据
- 星标
- 571
- 派生
- 80
- 平均合并
- 14 小时 43 分钟
- 30 天内合并 PR
- 5
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
forcedotcom/cli 的其他 Issue
-
sf agent mcp asset replace --assets null throws raw TypeError instead of InvalidShape可能已有人在做 @konkonrong-lgtm 于 71 天前认领。 未关闭area:afdx bug investigating owned by another team validated
难度 2/5 1-3 小时 新手友好度 78/100
forcedotcom/cli#3625 · 4 条评论 ·
-
area:afdx bug owned by another team
难度 2/5 1-3 小时 新手友好度 78/100
forcedotcom/cli#3608 · 2 条评论 ·
-
announcement
难度 1/5 1 小时以内 新手友好度 1/100
forcedotcom/cli#3668 ·
-
bug investigating validated
难度 3/5 1-2 天 新手友好度 66/100
forcedotcom/cli#3667 · 5 条评论 ·
-
[BUG]: sf package version create always warns about org-capitalize-record-types, even when it's set未关闭area:packaging more information required owned by another team regression stale
难度 3/5 1-2 天 新手友好度 52/100
forcedotcom/cli#3663 · 5 条评论 ·
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
backend enhancement priority:P3
难度 2/5 1-3 小时 新手友好度 78/100
geolens-io/geolens#3310 ·
维护者通常 1 天内回复
-
Area: DVR P2 S
难度 2/5 1-3 小时 新手友好度 78/100
Dispatcharr/Dispatcharr#1867 · 1 条评论 ·
维护者通常 4 天内回复
-
good first issue
难度 2/5 1-3 小时 新手友好度 84/100
ronaldorfas/Tudoappn2#1 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
doobidoo/mcp-memory-service#1650 ·
维护者通常 1 天内回复