Summary
Running aem content push after editing a JSON file logs ✓ and advances the synced ref, but the file in DA is unchanged.
Root Cause
putSource in src/content/da-api.js sends all files via PUT with a raw request body and Content-Type set to the file's MIME type (e.g. application/json for .json files).
The DA admin API (admin.da.live) only accepts raw body uploads for text/html. For application/json (and every other content type), putHelper in da-admin returns undefined. putObject then writes an empty {} to the file's props sidecar and skips the content file entirely. It still returns 201 with a valid JSON body, so helix-cli treats the push as successful and advances the synced ref. The file change is silently dropped.
This appears to be intentional da-admin behavior. The test suite asserts it:
it('Returns undefined for application/json raw body', async () => {
// ...
assert.strictEqual(helped, undefined);
});
What the DA API Expects
The DA API docs (https://docs.da.live/developers/api/source) require multipart/form-data POST for all file types:
# JSON file
curl -X POST \
'https://admin.da.live/source/org/site/data.json' \
--header 'Authorization: Bearer {IMS_TOKEN}' \
--form 'data=@/path/to/data.json'
The server accepts both PUT and POST (same handler), so the HTTP method is not the issue. The body format is.
Impact
Any non-HTML file pushed via aem content push silently fails to update in DA.
Fix
Update putSource to use POST + multipart/form-data for all file types, wrapping the buffer in a Blob in the data field. The text/html raw body path is an undocumented server-side shortcut and should not be the basis for how helix-cli uploads files.
Summary
Running
aem content pushafter editing a JSON file logs✓and advances the synced ref, but the file in DA is unchanged.Root Cause
putSourceinsrc/content/da-api.jssends all files viaPUTwith a raw request body andContent-Typeset to the file's MIME type (e.g.application/jsonfor.jsonfiles).The DA admin API (
admin.da.live) only accepts raw body uploads fortext/html. Forapplication/json(and every other content type),putHelperin da-admin returnsundefined.putObjectthen writes an empty{}to the file's props sidecar and skips the content file entirely. It still returns201with a valid JSON body, so helix-cli treats the push as successful and advances the synced ref. The file change is silently dropped.This appears to be intentional da-admin behavior. The test suite asserts it:
What the DA API Expects
The DA API docs (https://docs.da.live/developers/api/source) require multipart/form-data POST for all file types:
The server accepts both
PUTandPOST(same handler), so the HTTP method is not the issue. The body format is.Impact
Any non-HTML file pushed via
aem content pushsilently fails to update in DA.Fix
Update
putSourceto usePOST+multipart/form-datafor all file types, wrapping the buffer in aBlobin thedatafield. Thetext/htmlraw body path is an undocumented server-side shortcut and should not be the basis for how helix-cli uploads files.