Skip to content

Commit 393506c

Browse files
committed
fix: add web_app file responses for retrieve operations
- Retrieve now reports individual files for web_app bundles - Fixes 'Nothing retrieved' warning when retrieving web_app bundles - Matches the deploy behavior for consistent file response reporting
1 parent f308b45 commit 393506c

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/client/metadataApiRetrieve.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,25 @@ export class RetrieveResult implements MetadataTransferResult {
101101

102102
// construct successes
103103
for (const retrievedComponent of this.components.getSourceComponents()) {
104-
const { fullName, type, xml } = retrievedComponent;
104+
const { fullName, type, xml, content } = retrievedComponent;
105105
const baseResponse = {
106106
fullName,
107107
type: type.name,
108108
state: this.localComponents.has(retrievedComponent) ? ComponentStatus.Changed : ComponentStatus.Created,
109109
} as const;
110110

111-
if (!type.children || Object.values(type.children.types).some((t) => t.unaddressableWithoutParent)) {
111+
// Special handling for web_app bundles - they need to walk content and report individual files
112+
const isWebAppBundle = type.name === 'DigitalExperienceBundle' && fullName.startsWith('web_app/') && content;
113+
114+
if (isWebAppBundle) {
115+
const walkedPaths = retrievedComponent.walkContent();
116+
// Add the bundle directory itself
117+
this.fileResponses.push({ ...baseResponse, filePath: content } satisfies FileResponseSuccess);
118+
// Add each file with its specific path
119+
for (const filePath of walkedPaths) {
120+
this.fileResponses.push({ ...baseResponse, filePath } satisfies FileResponseSuccess);
121+
}
122+
} else if (!type.children || Object.values(type.children.types).some((t) => t.unaddressableWithoutParent)) {
112123
for (const filePath of retrievedComponent.walkContent()) {
113124
this.fileResponses.push({ ...baseResponse, filePath } satisfies FileResponseSuccess);
114125
}

0 commit comments

Comments
 (0)