Skip to content

RequireJS resolver sometimes fails to detect blocked resources #28116

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ishakhsuvarov opened this issue May 5, 2020 · 10 comments · Fixed by #28117
Closed

RequireJS resolver sometimes fails to detect blocked resources #28116

ishakhsuvarov opened this issue May 5, 2020 · 10 comments · Fixed by #28117
Assignees
Labels
Component: Ui Fixed in 2.4.x The issue has been fixed in 2.4-develop branch Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: done Release Line: 2.4 Reported on 2.3.5-p1 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Severity: S2 Major restrictions or short-term circumventions are required until a fix is available. Triage: Done Has been reviewed and prioritized during Triage with Product Managers

Comments

@ishakhsuvarov
Copy link
Contributor

Preconditions (*)

  1. Magento 2.3.5-p1. Most likely any recent release would be affected.

Steps to reproduce (*)

  1. Create a custom RequireJS config which defines a component complete with its url and fallback path. For example:
var config = {
    paths: {
        a: ['https://example.com/advertisement.js', 'Custom_Module/js/noop']
    }
};
  1. Include this component on Checkout (may be reproducible elsewhere)
<!-- Something simple like this would work: -->
<script type="text/x-magento-init">
    {
        "*": {
            "a": {}
        }
    }
</script>
  1. Use a browser with any aggressive Ad Blocker extension which would block the required url
  2. Open Checkout page

Expected result (*)

  1. ✅ Ad Blocker extension blocks the script download from the url stated in RequireJS config (https://example.com/advertisement.js)
  2. ✅ Checkout page loads and renders just fine

Actual result (*)

  1. ✅ Ad Blocker Extension blocks script download from the original url
  2. ℹ️ RequireJS uses path fallback mechanism to load a resource from second url, therefore not triggering an error.
  3. ℹ️ Magento's RequireJS resolver cannot keep track of such events and continues to wait for original resource to load (as no error was produced), therefore not calling any of the callbacks.
  4. ❌ Checkout page is displaying 2 spinning loaders and a fully rendered page under it as resolver does not track components which were loaded via fallbacks.
@m2-assistant
Copy link

m2-assistant bot commented May 5, 2020

Hi @ishakhsuvarov. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, please, review the Magento Contributor Assistant documentation.

@ishakhsuvarov do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label May 5, 2020
@ghost ghost assigned ishakhsuvarov May 5, 2020
@VladimirZaets VladimirZaets added Component: Ui Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Release Line: 2.4 labels May 6, 2020
@magento-engcom-team
Copy link
Contributor

@VladimirZaets Thank you for verifying the issue.

Unfortunately, not enough information was provided to acknowledge ticket. Please consider adding the following:

  • Add "Reproduced on " label(s) to this ticket based on verification result

Once all required information is added, please add label "Issue: Confirmed" again.
Thanks!

@magento-engcom-team magento-engcom-team removed the Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed label May 6, 2020
@VladimirZaets VladimirZaets added Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels May 6, 2020
@magento-engcom-team magento-engcom-team added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label May 6, 2020
@magento-engcom-team
Copy link
Contributor

✅ Confirmed by @VladimirZaets
Thank you for verifying the issue. Based on the provided information internal tickets MC-34099 were created

Issue Available: @VladimirZaets, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@VladimirZaets VladimirZaets added Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Severity: S2 Major restrictions or short-term circumventions are required until a fix is available. labels May 6, 2020
@VladimirZaets VladimirZaets added this to the 2.4.1 milestone May 6, 2020
@VladimirZaets VladimirZaets linked a pull request May 6, 2020 that will close this issue
4 tasks
@hostep
Copy link
Contributor

hostep commented May 6, 2020

@ishakhsuvarov: out of curiosity: is this regarding the checkout no longer working on the Magento Marketplace when uBlock Origin is active?

@sdzhepa sdzhepa added the Triage: Ready for Triage Issue is ready to me triaged with Product Manager label May 7, 2020
@ishakhsuvarov
Copy link
Contributor Author

@hostep sorry for the delay. Yes, this is exactly that issue which started as your report on slack :)

Thank you for your participation!

@sdzhepa sdzhepa removed the Triage: Ready for Triage Issue is ready to me triaged with Product Manager label May 18, 2020
@sdzhepa sdzhepa added the Triage: Done Has been reviewed and prioritized during Triage with Product Managers label May 18, 2020
@sidolov sidolov removed this from the 2.4.1 milestone Aug 20, 2020
@engcom-Charlie
Copy link
Contributor

Hi @ishakhsuvarov we are not able to reproduce this issue on the latest 2.4-develop branch by provided steps.
Could you please take a look?
Thank you.

@magento-engcom-team
Copy link
Contributor

Hi @ishakhsuvarov. Thank you for your report.
The issue has been fixed in #28117 by @ishakhsuvarov in 2.4-develop branch
Related commit(s):

The fix will be available with the upcoming 2.4.2 release.

@magento-engcom-team magento-engcom-team added the Fixed in 2.4.x The issue has been fixed in 2.4-develop branch label Sep 21, 2020
@magento-engcom-team magento-engcom-team added the Reported on 2.3.5-p1 Indicates original Magento version for the Issue report. label Nov 13, 2020
@rav-redchamps
Copy link
Contributor

Hey @ishakhsuvarov,

The changes in your pull request #28117 is causing issue with admin ui component grids.

Steps to reproduce:

  1. Login to admin panel & navigate to Catalog > Products grid
  2. Filter grid by some SKU
  3. Close the browser window
  4. Open admin panel in new private/incognito window
  5. Go to Catalog > Product Grids

Expected result (*)

✅ Grid should be filtered by SKU

Actual result (*)

ℹ️ You will see that grid has SKU filter applied but it still show all the records

@hostep
Copy link
Contributor

hostep commented Jul 28, 2021

@rav-redchamps: could you open a new issue describing this issue and link to that PR? That will make sure the issue is being followed up, commenting on closed issues often doesn't seem to help here.

@rav-redchamps
Copy link
Contributor

@hostep Done ✅ #33620

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Ui Fixed in 2.4.x The issue has been fixed in 2.4-develop branch Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: done Release Line: 2.4 Reported on 2.3.5-p1 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Severity: S2 Major restrictions or short-term circumventions are required until a fix is available. Triage: Done Has been reviewed and prioritized during Triage with Product Managers
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

8 participants