-
Notifications
You must be signed in to change notification settings - Fork 376
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
fix: wait with bootstraping the app until OAuth params are checked in the URL #15831
Conversation
Test summaryRun details
View run in Cypress Dashboard ➡️ Flakiness
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
Public API changes💥 @spartacus/assetsLibrary no longer can be analyzed with api-extractor. Please check the errors:
💥 @spartacus/cart/import-export/rootLibrary no longer can be analyzed with api-extractor. Please check the errors:
💥 @spartacus/cartLibrary no longer can be analyzed with api-extractor. Please check the errors:
💥 @spartacus/checkoutLibrary no longer can be analyzed with api-extractor. Please check the errors:
💥 @spartacus/corePrevious error: 💥 @spartacus/epd-visualization/epd-visualization-apiLibrary no longer can be analyzed with api-extractor. Please check the errors:
💥 @spartacus/product/bulk-pricing/occLibrary no longer can be analyzed with api-extractor. Please check the errors:
💥 @spartacus/productLibrary no longer can be analyzed with api-extractor. Please check the errors:
💥 @spartacus/product/variants/occLibrary no longer can be analyzed with api-extractor. Please check the errors:
💥 @spartacus/product-configuratorLibrary no longer can be analyzed with api-extractor. Please check the errors:
💥 @spartacus/setup/ssrLibrary no longer can be analyzed with api-extractor. Please check the errors:
💥 @spartacus/trackingLibrary no longer can be analyzed with api-extractor. Please check the errors:
💥 @spartacus/tracking/tmsLibrary no longer can be analyzed with api-extractor. Please check the errors:
|
… the URL (#15831) ### Context When OAuth implicit or code flow is configured, on page start (especially when returing from the external auth server to Spartacus), we attempt to retrieve the access token from the URL, with the method `authService.checkOAuthParamsInUrl()`. During the execution of this method, the long OAuth authorization_code handshake can happen. Therefore the access token might be retireved with a delay. ### Before fix Previously we didn’t wait until the access token is retireved, but started bootstrapping the application right away, including running of the route guards. Especially it was possible to run the AuthGuard, before we retireved the access token by the method `authService.checkOAuthParamsInUrl()`. This could result in AuthGuard blocking the navigaiton becasue the user was **not yet** logged in (however awaiting the access token in the background). ### After fix Now we wait for `authService.checkOAuthParamsInUrl()` to resolve, and only then we proceed with bootstrapping the application and running the guards, including `AuthGuard`. fixes #13622 fixes CXSPA-405
… the URL #15831 [backport to 4.3.x] (#15873) (It's a backport of #15831 to 4.3.x) ### Context When OAuth implicit or code flow is configured, on page start (especially when returing from the external auth server to Spartacus), we attempt to retrieve the access token from the URL, with the method `authService.checkOAuthParamsInUrl()`. During the execution of this method, the long OAuth authorization_code handshake can happen. Therefore the access token might be retireved with a delay. ### Before fix Previously we didn’t wait until the access token is retireved, but started bootstrapping the application right away, including running of the route guards. Especially it was possible to run the AuthGuard, before we retireved the access token by the method `authService.checkOAuthParamsInUrl()`. This could result in AuthGuard blocking the navigaiton becasue the user was **not yet** logged in (however awaiting the access token in the background). ### After fix Now we wait for `authService.checkOAuthParamsInUrl()` to resolve, and only then we proceed with bootstrapping the application and running the guards, including `AuthGuard`. fixes #13622 fixes CXSPA-405
* refactor: Enable strict mode for storefrontlib (#15770) * feature/CXSPA-390 (#15796) fixed my company drop down arrow * fix: minimum width and height adjustment to buttons and links on mobile (#15784) * feature/CXSPA-440 Added min height at mobile screen size for elements that were not passing light house seo test * feature/CXSPA-440 added more changes for link and button min height and width * feature/CXSPA-440 prettier clean up Co-authored-by: Miguel Estrada <15113219+developpeurweb@users.noreply.github.com> * feat: add child component to productDetailsTab (#15808) A child component is injected within ProductDetails tab, below the product details text. This change has been made to allow PDF component to be displayed below product details. * style: fix product listing buttons (#15659) * feature/CXSPA-233 updated button sizes * feature/CXSPA-233 fixed button sizes * Trigger Build * Trigger Build * Fixed width issue of buttons * Fixed failing test cases * Trigger Build * Trigger Build Co-authored-by: Miguel Estrada <15113219+developpeurweb@users.noreply.github.com> Co-authored-by: Giancarlo Cordero Ortiz <46171897+giancorderoortiz@users.noreply.github.com> Co-authored-by: Dalvir Singh <dalvir.singh@sap.com> * fix: Lock CI jobs to use angular 13 instead of the latest tag (#15821) context: - the ci workflow contained some jobs that needed angular to be installed such as lighthouse, unit test lib, and unit core. However, they downloaded the angular/cli with the @latest tag. Reason being, we wanted the pipeline to run with the latest angular and not a specific angular 13 minor/patch. - 5 days ago the latest tag was set to 14.0.0, therefore causing issues to our pipeline. closes https://jira.tools.sap/browse/CXSPA-565 * test: fix strict mode issues in attribute related tests (#15819) closes #15818 * feat: New schematics installer mechanism (#15459) closes #15380 * feat: support attribute types with additional values (#15699) 4 additional attribute types: Dropdown and radio group with additional alphanumeric or numeric values Closes #15688 * feat: Add to cart from order history and saved cart (#15736) Add Buy It Again from order history Add Add to Current Cart from saved cart closes https://jira.tools.sap/browse/CXSPA-308 * chore: Re-wire the events in checkout for better readability and tracing (#15789) closes https://jira.tools.sap/browse/CXSPA-519 * feat: integrate with store finder service (#15820) feat: integrate with store finder service CXSPA-544 * chore: migration schematics and documentation for new configurator attribute types closes #15689 * feat: Merchant can customize Product Carousels with inner components ex. Add To Cart (#15817) * Add add-to-cart to product carousel * Cannot use absolute path outside of spec files - exporting ProductCarouselComponent sub-component * Using mock ProductCarouselItem for product-carousel tests and moving UI tests to product-carousel-item Providing type for Product Removing unnecessary config in product-carousel module as it goes unseen by the customer anyway SCSS for showing multiple CMS components in product-carousel-item * E2E test for customizing Product Carousel component with Add to Cart button * Setting the ChangeDetectionStrategy for ProductCarouselItemComponent to OnPush * Adding documentation for breaking change for ProductCarouselComponent Updating migration docs to have selector of new CarouselItemComponent * Provide empty string for the Carousel Item's image if the product has no name Co-authored-by: i822892 <arkadiy.sukharenko@sap.com> Co-authored-by: Giancarlo Cordero Ortiz <46171897+giancorderoortiz@users.noreply.github.com> * fix: Move cart core code out of the 'main' chunk (#15816) closes https://jira.tools.sap/browse/CXSPA-542 * add password visibility test (#15812) * add password visibility test * password visibility test * changes requested for pwd visibility * removed duplicated clear from password test Co-authored-by: Brian Gamboc-Javiniar <brian_javiniar@hotmail.com> * test: Password visibility e2e changes * chore: Adjust CPQ user (#15829) Adjust CPQ user and its credentials for cypress tests Closes #15828 * doc: Update schematics readme (#15841) This PR updates the internal schematics README.md file. * fix: wait with bootstraping the app until OAuth params are checked in the URL (#15831) ### Context When OAuth implicit or code flow is configured, on page start (especially when returing from the external auth server to Spartacus), we attempt to retrieve the access token from the URL, with the method `authService.checkOAuthParamsInUrl()`. During the execution of this method, the long OAuth authorization_code handshake can happen. Therefore the access token might be retireved with a delay. ### Before fix Previously we didn’t wait until the access token is retireved, but started bootstrapping the application right away, including running of the route guards. Especially it was possible to run the AuthGuard, before we retireved the access token by the method `authService.checkOAuthParamsInUrl()`. This could result in AuthGuard blocking the navigaiton becasue the user was **not yet** logged in (however awaiting the access token in the background). ### After fix Now we wait for `authService.checkOAuthParamsInUrl()` to resolve, and only then we proceed with bootstrapping the application and running the guards, including `AuthGuard`. fixes #13622 fixes CXSPA-405 * feature/CXSPA-524 (#15815) updated styling for mobile viewport of table header * test: fix flaky VC e2e tests Closes #15827 * feature/CXSPA-298 (#15810) Fixed tablet size input check box alignment Co-authored-by: Miguel Estrada <15113219+developpeurweb@users.noreply.github.com> * chore: install VC configurator by default in the internal installation script (#15844) Previously the Variant Configurator was not installed by default in our internal installation script `/install/run.sh`. It was installed implicitly only in case when installing CPQ extension (with `ADD_CPQ` flag). Since the the PR #15459 was merged, the CPQ installation is aborted if VC was not installed explicitly before. In this PR we update the installation script to: install the Variant Configurator first explicitly (by default), and only then conditionally (with `ADD_CPQ` flag) install CPQ extension on top of it. fixes https://jira.tools.sap/browse/CXSPA-588 * CXSPA-545 BOPIS Store List (#15852) Add store list components. CXSPA-545 Co-authored-by: Christopher Michael <chris.michael@sap.com> Co-authored-by: mechris3 <mechris3@hotmail.com> Co-authored-by: cawmichae <cawmichae@users.noreply.github.com> Co-authored-by: I554698 <surya.singh@sap.com> * refactor: Enable strict mode for core lib (#15807) * refactor: Remove media component deprecations from 4.2 (#14236) Deprecation removals for #13172 * feat: CXSPA-600 Remove deprecated errors$ field (#15867) * feat: Enhance overview normalizer to display value price (#15866) Enable displaying value prices on the overview page for VC products Closes: #15840 * fix: Spinner in guest checkout after event refactoring (#15870) fixes guest checkout infinite loop in delivery address after checkout event refactoring https://jira.tools.sap/browse/CXSPA-603 * feature/CXSPA-591 (#15859) fixed import products modal button * chore: lint integration libs with i18n-lint (#15877) `i18n-lint` checks if no hardcoded texts appear in the HTML templates Previously integration-libs were not linted, but only feature-libs and the storefrontlib. Now integration libs are also linted. Btw. removed the `--exclude` of node_modules folder, as being redundant - node_modules don't overlap with any allowlisted files. fixes https://jira.tools.sap/browse/CXSPA-627 * chore: AuthRedirectService methods deprecation cleanup and migration (#14481) Closes: #14459 * chore: skip flaky B2B saved cart E2E test for now * chore: improve guest checkout e2e tests (#15876) * Changed font-weight and size to fix the amp button contrast Co-authored-by: Miguel Estrada <15113219+developpeurweb@users.noreply.github.com> * style: change order replenish table styling to match my company table * style: Added padding to the order date Co-authored-by: Miguel Estrada <15113219+developpeurweb@users.noreply.github.com> * chore: Remove deprecated notices for vouchers. (#15864) * chore: Remove deprecated styling class for quick order form component * chore: Protect deprecated cmfRef in ComponentWrapperDirective (#15878) * refactor: Enable strict mode for organization lib * chore: remove deprecated code from OccEndpoints model closes https://jira.tools.sap/browse/CXSPA-597 * chore: User service deprecation * chore: Remove deprecated keyboard focus config and on navigate focus … (#15871) * fix: Site freezes after agent logs out of ASM (#15880) * Revert "Site freezes when logging out of ASM (#14914) (#15375)" * Explicitly set logout process back to false after the operation has completed * Create e2e and unit tests to verify new logout behavior * Create duplicate e2e util functions for waitForPage and waitForCategory in central navigation.ts. To be consolidated in future ticket. * Improving billing address e2e tests (#15891) * Removing it blocks * Asserting on registration is not in scope for this test * No need to enter this addres again * Using a shortcut to register and login test user * Trigger Build * Trigger Build Co-authored-by: KateChuen <45409515+KateChuen@users.noreply.github.com> Co-authored-by: KateChuen <kate.chuen.cheong@sap.com> * fix: Allow to place order during midnight time (#15901) - remove date bug, where 24h time for midnight translates to 24:xx instead of 00:xx. Basically, backend for the replenishment endpoint does not accept 24 for midnight, but 00 / reference to fix conversion https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/hourCycle * test: Enhance checkout replenishment e2e (#15887) included fixtures for the checkout replenishment e2e and testing with premium delivery instead of standard delivery like all our other checkout e2e does closes https://jira.tools.sap/browse/CXSPA-530 * test: Fix anonymous consent config e2e (#15902) Change the user journey in the e2es by making user anonymous consents gets loaded before creating the user and navigating to the consent page. closes https://jira.tools.sap/browse/CXSPA-653 * feat: Fetching products in carousel with stock information (#15838) * Fetching products in carousel with stock information * As PRODUCT_SCOPE in ProductCarouselComponent has been changed into a list, using other scopes when fetching products is redundant * Rewriting unit test for ProductCarouselComponent to use done() callback for assertions in subscription * Trigger Build * Adding new ProductScope for stock information only - using this scope instead of DETAILS for ProductCarousel Co-authored-by: pla <plabadie@users.noreply.github.com> * chore: improve clear cart core e2e tests (#15886) * CXSPA-554 Integrate store stock level (#15912) Integrate pickup in store with the stock level API. Co-authored-by: I554698 <surya.singh@sap.com> Co-authored-by: mechris3 <mechris3@hotmail.com> Co-authored-by: cawmichae <cawmichae@users.noreply.github.com> * fix: Lint issue * test: Improve currency checkout page core e2e (#15909) closes https://jira.tools.sap/browse/CXSPA-656 * chore: fix "Public API Changes" bot (#15883) ### Improvements - make the "Public API changes" bot back working in CI (get rid of all the errors in the script) - side effect: reduce the time of executing "Public API changes" bot from 2h back to ~30min (see [test PR](https://github.com/SAP/spartacus/actions/runs/2580268027)) - reduced the warnings noise in logs: - disabled API-extractor warnings not relevant in our project, e.g. [warning for missing release tags like alpha/beta/internal/public in our TSDocs](https://api-extractor.com/pages/messages/ae-missing-release-tag/), - disabled API-extractor warnings about missing exports, because sometimes caused false-positive warnings e.g. when an interface is exported, but from a different library - disabled all warnings from TSDocs parser (checking the syntax of TSDocs is not in scope of our breaking changes detection bot; generated ~30k warnings per script execution before) - reduced the warnings noise in the report comment: - API Extractor warnings are not printed to the report comment, but only in the console of the script - to avoid fake reports because of a different file path, for example: ```diff -// /github/workspace/branch-clone/dist/<...file path> - <warning message> +// /github/workspace/dist/<...file path> - <warning message> ``` ### Changes - analyze d.ts instead of TS files in dependent libraries (e.g. when finding `import {X} from '@spartacus/core'`, analyze `dist/core/.../.d.ts` instead of `/projects/core/.../.ts`) - disable api-extractor warning of type `ae-missing-release-tag` and `ae-forgotten-export` - disable all TSDoc warnings (of type `tsdocMessageReporting`) - disable reporting warnings in the markdown report, but leave them in the script console output - add explicit return type for `APP_INITIALIZER`s that returned `()=>Promise<Config>` - to avoid api-extractor error `ERROR: Failed to fetch entity for import() type node: import("@spartacus/core").Config` - by the way, I added also missing return types for other `APP_INITIALIZER`s, which was not essential for this PR - by the way, removed some redundant JSDoc notices `@member` from `occ-models.ts` - which caused warnings in api-extractor and were redundant ### Implementation notes Previously for API Extractor tool we used the tsconfig with path mappings to source code (e.g. for resolving an import from `@spartacus/core` it looked up the source code TS files in `projects/core/*`). According to https://api-extractor.com/pages/messages/ae-wrong-input-file-type/ , it seems that we were using the api-extractor tool not in a way that the tool's authors assumed. We analyzed TS files (only in dependency packages), but api-extractor expects to analyze d.ts Moreover, since API Extractor v7.24.0 (released 2022-05-14), analyzing TS files throws an error (see [changelog](https://github.com/microsoft/rushstack/blob/main/apps/api-extractor/CHANGELOG.md#7240) and [troubleshooting page](https://api-extractor.com/pages/messages/ae-wrong-input-file-type/)), which caused our CI script for api-extractor to fail since 2022-05-14. In this PR, we start using the "production" version of `tsconfig` (`tsconfig.app.prod.json` instead of `tsconfig.json`), which uses `"paths"` mapping to the `/dist` folder, which contains d.ts files. * doc: define the max version of Angular version per Spartacus version (#15001) * chore: fix flaky cart e2e test (#15916) * chore: add important note in GH release template to avoid unnecessary commits and tags * chore: add important notes for new releases * Adding instructions for core tag * refactor: make anchors compliant with checkmarx (#15932) Anchors tags have been refactored to be compliant with the new pipeline security check. Attribute 'rel' has been added to anchors that are using _blank as target. * test: Improve asm flaky e2es (#15929) Notes: - removed redundant registration that happens twice at the beginning and other duplicate tasks - make sure to wait for asm input box to no longer be disabled before typing - removed unused functions - removed duplicates and reuse the intended function for customer emulation tests - instead of visiting a page by using cy.visit, we use the my-account dropdown instead. Visiting pages is not a user journey on how a user would navigate the page. Also, visiting a page is like a refresh as it's changing the url and going to that route through the browser instead of making it a user journey (an end to end test). - in addition, the visit caused most of the customer agent session timeout because of some existing bug in the feature --- important: - reproducible asm agent session timeout as shown in videos by just waiting ~6 mins in a page. Needs fix in feature for token expiration instead, however, the videos in the issue shows that flakiness as well (not related to session timeout), which should be fixed by this PR closes https://jira.tools.sap/browse/CXSPA-661 * chore: Spinner on use my location, pick up in store button etc * fix: remove cart with invalid products (#14228) (#15548) * changes to addEntries * added test case * delete cart test update * updated test * test refactor * account for UNKNOWN_ERROR as well * add test for UNKNOWN_ERROR * chore: Changes for New Schematics and otherminor changes * fix: yarn config updates * fix: add .scss suffix in schematic * fix: Schematics and Test Cases * fix: Schematics Test for pick up in store * fix: Schematics Test for pick up in store Snapshot updates * chore: fix sementic test case * fix: test case * feat: remove storefinder dependency * fix: Test Case Co-authored-by: Weizheng Gao <44440575+WeizhengSap@users.noreply.github.com> Co-authored-by: morganm58 <mikel.morgan@sap.com> Co-authored-by: Miguel Estrada <15113219+developpeurweb@users.noreply.github.com> Co-authored-by: Florent Letendre <florent.letendre01@sap.com> Co-authored-by: Giancarlo Cordero Ortiz <46171897+giancorderoortiz@users.noreply.github.com> Co-authored-by: Dalvir Singh <dalvir.singh@sap.com> Co-authored-by: Brian Gamboc-Javiniar <brian_javiniar@hotmail.com> Co-authored-by: Christoph Hinssen <33626130+ChristophHi@users.noreply.github.com> Co-authored-by: Nikola Zarić <nikola.zaric.ns@gmail.com> Co-authored-by: Parthlakhani <parth.lakhani@sap.com> Co-authored-by: justinlee01 <47992455+justinlee01@users.noreply.github.com> Co-authored-by: i822892 <arkadiy.sukharenko@sap.com> Co-authored-by: KateChuen <45409515+KateChuen@users.noreply.github.com> Co-authored-by: Gilberto Alvarado <gilberto.alvarado.jimenez@sap.com> Co-authored-by: LarisaStar <61147963+Larisa-Staroverova@users.noreply.github.com> Co-authored-by: Krzysztof Platis <platonn.git@gmail.com> Co-authored-by: Christopher Michael <chris.michael@sap.com> Co-authored-by: mechris3 <mechris3@hotmail.com> Co-authored-by: cawmichae <cawmichae@users.noreply.github.com> Co-authored-by: I554698 <surya.singh@sap.com> Co-authored-by: Caine Rotherham <rotherham.c@gmail.com> Co-authored-by: pawelfras <fras.pawel@yahoo.com> Co-authored-by: Patryk Smul <psmul@divante.pl> Co-authored-by: Radhep Sabapathipillai <34665674+RadhepS@users.noreply.github.com> Co-authored-by: pla <plabadie@users.noreply.github.com> Co-authored-by: Mateusz Kolasa <mateusz.kolasa@sap.com> Co-authored-by: Jeremy Laverdiere <88747151+bullfroggy-sap@users.noreply.github.com> Co-authored-by: KateChuen <kate.chuen.cheong@sap.com> Co-authored-by: Andi Braimllari <101869667+I539321@users.noreply.github.com>
Context
When OAuth implicit or code flow is configured, on page start (especially when returing from the external auth server to Spartacus), we attempt to retrieve the access token from the URL, with the method
authService.checkOAuthParamsInUrl()
. During the execution of this method, the long OAuth authorization_code handshake can happen. Therefore the access token might be retireved with a delay.Before fix
Previously we didn’t wait until the access token is retireved, but started bootstrapping the application right away, including running of the route guards. Especially it was possible to run the AuthGuard, before we retireved the access token by the method
authService.checkOAuthParamsInUrl()
. This could result in AuthGuard blocking the navigaiton becasue the user was not yet logged in (however awaiting the access token in the background).After fix
Now we wait for
authService.checkOAuthParamsInUrl()
to resolve, and only then we proceed with bootstrapping the application and running the guards, includingAuthGuard
.fixes #13622
fixes CXSPA-405