Uploaded image for project: 'Hippo CMS'
  1. Hippo CMS
  2. CMS-12225

React Bloomreach SDK fails to include query strings in requests used to update the pageModel

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Top
    • Resolution: Available for testing
    • None
    • None
    • None
    • Bloomreach React SDK
    • 0.5
    • Flagged
    • Tiger
    • Tiger Sprint 218, Tiger Sprint 219

    Description

      Scenario:

      A page in a REACT app with a component which checks certain query strings. The "Create Link" functionality is been used from Bloomreach React SDK to create links on the page, the links include a required query string in the URL passed to the route attribute.

       

      On loading the page, Bloomreach React SDK will render the CmsPage component described at https://github.com/bloomreach/experience-react-sdk/blob/24964400fe824dd52b0248cc7896cd03902b4a08/packages/sdk/src/cms-components/core/page.js

       

      This in turn calls fetchCmsPage() from https://github.com/bloomreach/experience-react-sdk/blob/master/packages/sdk/src/utils/fetch.js
      which calls buildApiUrl() while passing the query parameter.

       

      Internally, it seems that via this route our query string is correctly passed to the buildApiUrl() method. However, buildApiUrl() does not append the query string to the end of the URL when it is done. It only uses the querystring to check whether an ssoHandshake should be appended to the end. After this url without querystring is used by fetchCmsPage(), the fetched pageModel is updated with this.updatePageModel(data);

       

      The result is that our initial request to the page correctly had the querystrings that our component required.
      But this.updatePageModel(data) seemingly updates the state with the pagemodel data fetched from a request without querystrings. Effectively, the SDK overrides our data with the API response of an incorrect request.

       

      This effectively prevents us from using cross-page requests that include any kind of querystring directly inthe URL, such as a searchbox that takes you to a search results page

      Attachments

        Activity

          People

            Unassigned Unassigned
            mchhrapru Mohit Chhapru
            Hippo Helpdesk Hippo Helpdesk
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: