Uploaded image for project: 'Policy Framework'
  1. Policy Framework
  2. POLICY-3600

Some REST calls in Clamp GUI do not include pathname

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Medium
    • Resolution: Done
    • Istanbul Release
    • Istanbul Release
    • gui
    • None

    Description

      During the implementation of POLICY-3574, it was observed that some REST calls from Clamp GUI do not include the relative pathname (i.e. window.location.pathname).

      The bug, which appears multiple times, is related to the use of React's useState() returning immutable constants for state variables and async functions for setters, with those variables being updated and used within a closure (e.g. from useEffect()) - since React state variables are immutable, the old value gets captured in the closure. This results in incorrect path names in the REST URLs - this breaks the policy-gui Docker image.

      const [windowLocationPathname, setWindowLocationPathname] = useState('');

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              danielhanrahan Daniel Hanrahan
              danielhanrahan Daniel Hanrahan
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: