Details
-
Bug
-
Status: Closed
-
Medium
-
Resolution: Done
-
Istanbul Release
-
None
-
Policy 28/7-17/9
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
- relates to
-
POLICY-3574 Maven build for policy-gui
-
- Closed
-