-
Notifications
You must be signed in to change notification settings - Fork 15
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
IBX-7825: UDW Blank browse tab after going from bookmarks from search #1190
IBX-7825: UDW Blank browse tab after going from bookmarks from search #1190
Conversation
return () => { | ||
if (shouldRestorePreviousStateRef.current) { | ||
setMarkedLocationId(markedLocationId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: So, how the bug worked:
- User searches for e.g. "a"
- SearchTabModule component is instantiated and stores
markedLocationId
andloadedLocationsMap
which will be restored later on component destruction - The Search component uses
useSearchByQueryFetch
, which clears loaded locations data on fetching search results (this is why we store these data during 2.) - The user clicks Bookmark tab
- The SearchTabModule is destructed and functions restoring
markedLocationId
andloadedLocationsMap
are being called but their call is not yet processed on the React level - The BookmarksTabModule is being created.
- The BookmarksTabModule stores current
markedLocationId
andloadedLocationsMap
in order to restore them later, but at the time of storing them, they haven't been restored yet in React assetMarkedLocationId
anddispatchLoadedLocationsAction
haven't been processed yet. - The BookmarksTabModule performs clearance
setMarkedLocationId(null); dispatchLoadedLocationsAction({ type: 'CLEAR_LOCATIONS' });
- functions are being called, but not processed yet by React. setMarkedLocationId
anddispatchLoadedLocationsAction
from the SearchTabModule are being processed by React but it is too late for the BookmarksTabModule to store them as it already did it.setMarkedLocationId
anddispatchLoadedLocationsAction
from the BookmarksTabModule are being processed by React- The user clicks on the Browse tab
- The BookmarksTabModule is being destructed and restores wrong
markedLocationId
andloadedLocationsMap
.
src/bundle/ui-dev/src/modules/universal-discovery/bookmarks.tab.module.js
Outdated
Show resolved
Hide resolved
src/bundle/ui-dev/src/modules/universal-discovery/bookmarks.tab.module.js
Outdated
Show resolved
Hide resolved
7770e2c
to
b9c5e4d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've found one issue:
- Log in to the back office
- Click Create content from Quick actions
- Switch View into Grid view
- Click Bookmarks button
- Click search button and type for ex. "abc", confirm
- Click Browse button - udw is empty
- Click again Bookmark button and then Browse button - udw gets closed
Console output:
react-dom.production.min.js:79 Uncaught TypeError: Cannot read properties of null (reading 'markedLocationId')
Screen.Recording.2024-03-05.at.11.30.53.mov
6f1123f
to
59753fb
Compare
Quality Gate passedIssues Measures |
@@ -10,6 +10,7 @@ import { getIconPath } from '@ibexa-admin-ui/src/bundle/Resources/public/js/scri | |||
|
|||
const SearchTabModule = () => { | |||
const tabsConfig = useContext(TabsConfigContext); | |||
const restorationStateRef = useRef(null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: problem analogical to the problem from Bookmarks (https://github.com/ibexa/admin-ui/pull/1190/files#r1502186952) occurs in the Search.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💪
v4.6
Checklist:
@ibexa/engineering
).