Skip to content

Easy upload bug bash#394

Draft
echen-adobe wants to merge 27 commits intostagefrom
easy-upload-bug-bash
Draft

Easy upload bug bash#394
echen-adobe wants to merge 27 commits intostagefrom
easy-upload-bug-bash

Conversation

@echen-adobe
Copy link
Copy Markdown
Contributor

@echen-adobe echen-adobe commented Apr 22, 2026

Summary

Briefly describe the features or fixes introduced in this PR.

Fix the back button of the easy upload widget not working after 1 upload.

Refactored code to be more readable.


Jira Ticket

Resolves: https://jira.corp.adobe.com/browse/MWPW-193429


Test URLs

Env URL
Before https://main--da-express-milo--adobecom.aem.page/express/
After https://easy-upload-bug-bash--da-express-milo--adobecom.aem.page/drafts/echen/easy-upload/remove-background
After https://easy-upload-bug-bash--da-express-milo--adobecom.aem.page/drafts/echen/easy-upload/convert-to-jpeg
After https://easy-upload-bug-bash--da-express-milo--adobecom.aem.page/drafts/echen/easy-upload/convert-to-png
After https://easy-upload-bug-bash--da-express-milo--adobecom.aem.page/drafts/echen/easy-upload/convert-to-svg
After https://easy-upload-bug-bash--da-express-milo--adobecom.aem.page/drafts/echen/easy-upload/crop-image
After https://easy-upload-bug-bash--da-express-milo--adobecom.aem.page/drafts/echen/easy-upload/resize-image
After https://easy-upload-bug-bash--da-express-milo--adobecom.aem.page/drafts/echen/easy-upload/edit-image

Verification Steps

  • Steps to reproduce the issue or view the new feature.
  • What to expect before and after the change.
    1. Visit this page and login.
  • https://easy-upload-bug-bash--da-express-milo--adobecom.aem.page/express/feature/image/remove-background
    1. Use the widget to go to the editor and synchronize your IMS session.
    1. For each of the other pages, use the primary CTA to launch the normal quick action flow.
    1. Use a QR code scanning service to test each QR code upload feature of the page and ensure that they end up in the same place as the primary CTA flow.

Additional Notes

(If applicable) Add context, related PRs, or known issues here.

commit 0b01a11670598340c74e5fd6d1363aaa2ff7548a
Author: Eric Chen <159481679+echen-adobe@users.noreply.github.com>
Date:   Mon Apr 20 11:52:16 2026 -0500

    refactor
@aem-code-sync
Copy link
Copy Markdown

aem-code-sync Bot commented Apr 22, 2026

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 PSI checks
  • Re-sync branch
Commits

@github-actions github-actions Bot added the Ready for Review Ready for peer review. label Apr 22, 2026
Copy link
Copy Markdown
Contributor

@meganthecoder meganthecoder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also missing unit tests on resetUploadSession, refreshEasyUploadQrIfConsumed, and bindEasyUploadSdkInitListener

Comment thread express/code/blocks/frictionless-quick-action/easy-upload-files/easy-upload.js Outdated
@aem-code-sync aem-code-sync Bot temporarily deployed to easy-upload-bug-bash April 23, 2026 19:53 Inactive
@aem-code-sync aem-code-sync Bot temporarily deployed to easy-upload-bug-bash April 23, 2026 20:04 Inactive
@aem-code-sync aem-code-sync Bot temporarily deployed to easy-upload-bug-bash April 23, 2026 20:20 Inactive
@echen-adobe
Copy link
Copy Markdown
Contributor Author

Thanks for the catch @meganthecoder , requesting another review now.

@echen-adobe echen-adobe added Ready for QA and removed Ready for Review Ready for peer review. labels Apr 27, 2026
Copy link
Copy Markdown
Contributor

@fullcolorcoder fullcolorcoder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some suggested code for adding replaceKey and a callout on tests

`[EasyUpload-UI] Deferred initialization failed: ${error?.message || error}`,
{ severity: 'error' },
);
showErrorToast?.(block, 'Failed to initialize QR code upload.');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const errorMsg = await replaceKey('qr-init-failed', getConfig());
showErrorToast?.(block, errorMsg || 'Failed to initialize QR code upload.');
// (add matching key to placeholders dict)

`[EasyUpload-UI] initializeQRCode failed: ${error?.name} ${error?.message}`,
{ severity: 'error' },
);
showErrorToast?.(block, 'Failed to load QR code.');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const errorMsg = await replaceKey('qr-init-failed', getConfig());
showErrorToast?.(block, errorMsg || 'Failed to load QR code.');
// (add matching key to placeholders dict)

const block = buildEasyUploadBlock();
sinon.stub(EasyUpload.prototype, 'initializeQRCode').resolves();
sinon.stub(EasyUpload.prototype, 'startUploadDetectionPolling');
const resetUploadSessionStub = sinon.stub(EasyUpload.prototype, 'resetUploadSession').resolves();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The resetUploadSession test only confirms the method is called (stubbed), not what it does. Since this clears timers and resets flags on a user-triggered back-nav path, a test on the actual behavior would give you a safety net if the internals change. Not a merge blocker, but worth a follow-up if you don't have time.

it('resetUploadSession clears polling intervals and resets upload state', async () => {
  const easyUpload = createInstance();
  easyUpload.qrRefreshInterval = setTimeout(() => {}, 10000);
  easyUpload.pollingInterval = setInterval(() => {}, 10000);
  easyUpload.uploadFinalized = true;
  easyUpload.uploadDetected = true;
  sinon.stub(easyUpload, 'stopUploadDetectionPolling');
  sinon.stub(easyUpload, 'cleanupAcpStorage').resolves();

  await easyUpload.resetUploadSession();

  expect(easyUpload.qrRefreshInterval).to.be.null;
  expect(easyUpload.pollingInterval).to.be.null;
  expect(easyUpload.uploadFinalized).to.be.false;
  expect(easyUpload.uploadDetected).to.be.false;
});

@nateyolles nateyolles added this to the Express-26.18 milestone Apr 27, 2026
@aem-code-sync aem-code-sync Bot temporarily deployed to easy-upload-bug-bash April 28, 2026 20:28 Inactive
This reverts commit c4f93d0.
@aem-code-sync aem-code-sync Bot temporarily deployed to easy-upload-bug-bash April 28, 2026 20:30 Inactive
@aem-code-sync aem-code-sync Bot temporarily deployed to easy-upload-bug-bash April 28, 2026 20:32 Inactive
@aem-code-sync aem-code-sync Bot temporarily deployed to easy-upload-bug-bash April 28, 2026 20:57 Inactive
@aem-code-sync aem-code-sync Bot temporarily deployed to easy-upload-bug-bash April 29, 2026 15:57 Inactive
@aem-code-sync aem-code-sync Bot temporarily deployed to easy-upload-bug-bash April 29, 2026 16:15 Inactive
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.

5 participants