Skip to content

[Release] Stage to Main#829

Merged
sanjayms01 merged 2 commits into
mainfrom
stage
Jun 24, 2026
Merged

[Release] Stage to Main#829
sanjayms01 merged 2 commits into
mainfrom
stage

Conversation

maagrawal16 and others added 2 commits June 22, 2026 08:43
…pe (#825)

## Description
Fixes the blocker where uploading `.ai` files fails validation with
"This file is in a format not supported for conversion to PDF"
(MWPW-198934). Affects any verb that accepts these formats, not just the
new ones.

**Root cause:** In `handleFileUpload`, the MIME was derived as
`file.type || getMimeType(file)`. Browsers report `.ai` as
`application/postscript` (wrong, non-empty), so the `||` keeps it and
skips the canonical-MIME fallback → not in `allowedFileTypes` →
rejected. (`.indd` reports empty → fallback rescues it; `.psd` reports
the correct type → both already worked.)

**Fix:** Flip the precedence to `(await this.getMimeType(file)) ||
file.type` so the extension-derived canonical MIME wins for the
proprietary formats `getMimeType` maps (`.ai`, `.psd`, `.indd`,
`.form`). All other extensions are unaffected. Also ensures the correct
`format` is sent to createAsset/connector. Added tests for `.ai`,
`.psd`, and `.jpg`.

> Confirmed separately with BE (@nemahaja) that the `jpg-to-pdf`
conversion path accepts AI/PSD/INDD as inputs.

## Related Issue
<!-- Link to the JIRA ticket or GitHub issue that this PR resolves -->
Resolves: [MWPW-198934](https://jira.corp.adobe.com/browse/MWPW-198934)
## Test URLs
<!-- List the URLs where the changes can be tested -->
-
https://stage--da-dc--adobecom.aem.page/acrobat/online/test/ai-to-pdf?unitylibs=mwpw-198934-upload-ai-images
-
https://stage--da-dc--adobecom.aem.page/acrobat/online/test/psd-to-pdf?unitylibs=mwpw-198934-upload-ai-images
-
https://stage--da-dc--adobecom.aem.page/acrobat/online/test/indd-to-pdf?unitylibs=mwpw-198934-upload-ai-images
-
https://stage--da-dc--adobecom.aem.page/acrobat/online/test/jpg-to-pdf?unitylibs=mwpw-198934-upload-ai-images

Co-authored-by: Manasvi Agrawal <maagrawal@Manasvis-MacBook-Pro.local>
<!-- Before submitting, please review all open PRs. -->

* add direct upload support to more convert verbs

Resolves: [MWPW-198657](https://jira.corp.adobe.com/browse/MWPW-198657)

**Test URLs:**
- Before:
https://main--da-dc--adobecom.aem.live/acrobat/online/jpg-to-pdf?martech=off&unitylibs=stage
- After:
https://main--da-dc--adobecom.aem.live/acrobat/online/jpg-to-pdf?martech=off&unitylibs=MWPW-198657

- Before:
https://main--da-dc--adobecom.aem.live/acrobat/online/png-to-pdf?martech=off&unitylibs=stage
- After:
https://main--da-dc--adobecom.aem.live/acrobat/online/png-to-pdf?martech=off&unitylibs=MWPW-198657

- Before:
https://main--da-dc--adobecom.aem.live/acrobat/online/ppt-to-pdf?martech=off&unitylibs=stage
- After:
https://main--da-dc--adobecom.aem.live/acrobat/online/ppt-to-pdf?martech=off&unitylibs=MWPW-198657

- Before:
https://main--da-dc--adobecom.aem.live/acrobat/online/excel-to-pdf?martech=off&unitylibs=stage
- After:
https://main--da-dc--adobecom.aem.live/acrobat/online/excel-to-pdf?martech=off&unitylibs=MWPW-198657

- Before:
https://main--dc-frictionless--adobecom.aem.live/heic-to-pdf?martech=off&unitylibs=stage
- After:
https://main--dc-frictionless--adobecom.aem.live/heic-to-pdf?martech=off&unitylibs=MWPW-198657

## Testing Notes

**Change:** Added `ppt-to-pdf`, `excel-to-pdf`, `jpg-to-pdf`,
`png-to-pdf`, and `heic-to-pdf` to `directUploadVerbs` in
`target-config.json`. Files ≤ 1 MB on these verbs now use the
single-step `POST /asset/upload` direct upload path instead of the
create-asset → chunk → finalize chain.

---

### For each verb (`ppt-to-pdf`, `excel-to-pdf`, `jpg-to-pdf`,
`png-to-pdf`, `heic-to-pdf`)

**Small file (≤ 1 MB) — direct upload path (new behavior)**
- [ ] Upload a valid file under 1 MB
- [ ] Verify the upload completes and redirects to Acrobat successfully
- [ ] Verify no finalize/polling step occurs (should be faster than
before)
- [ ] Verify the converted PDF opens correctly in Acrobat

**Large file (> 1 MB) — standard chunked path (unchanged behavior)**
- [ ] Upload a valid file over 1 MB
- [ ] Verify the upload follows the standard create-asset → chunk →
finalize flow
- [ ] Verify redirect to Acrobat and PDF opens correctly
- [ ] Confirm no direct upload endpoint is called for large files

---

### Regression: `word-to-pdf` (must be unaffected)
- [ ] Small file (≤ 1 MB, `.doc` or `.docx`): direct upload path still
works
- [ ] Large file (> 1 MB, `.doc` or `.docx`): chunked path with
finalize-await still works

### Regression: other verbs (`compress-pdf`, `pdf-to-word`, etc.)
- [ ] Verify upload and redirect behavior is unchanged for verbs not in
`directUploadVerbs`

---

Co-authored-by: Ruchika Sinha <tek10248@Ruchikas-MacBook-Pro.local>
@aem-code-sync

aem-code-sync Bot commented Jun 23, 2026

Copy link
Copy Markdown

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
In case there are problems, just click a checkbox below to rerun the respective action.

  • Re-run all PSI checks
  • Re-run failed PSI checks
  • Re-sync branch
Commits

@asonnalagi

Copy link
Copy Markdown
Collaborator

Done with stage validation, all looks fine. Found on issue on stage, Logged bug on that: MWPW-199486 Test results: MWPW-199469

@sanjayms01 sanjayms01 merged commit cbf640d into main Jun 24, 2026
13 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants