Skip to content
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

URL not updating after navigation #3654

Open
KremnevDmitry opened this issue Aug 28, 2024 · 1 comment · May be fixed by #3875
Open

URL not updating after navigation #3654

KremnevDmitry opened this issue Aug 28, 2024 · 1 comment · May be fixed by #3875
Assignees
Labels
in: flowui size: M type: bug Something isn't working

Comments

@KremnevDmitry
Copy link
Contributor

KremnevDmitry commented Aug 28, 2024

Environment

Jmix version: 2.3.999-SNAPSHOT
On version 2.4.999-SNAPSHOT the error becomes critical, the view cannot be opened, because History#replaceState does navigation when using React Routing.

Bug Description

In a special case (attached project) the URL route remains from the previous page.

Steps To Reproduce

  1. Run attached project
  2. Open Test entities view
  3. Open Users view

Current Behavior

URL: http://localhost:8080/testEntities?genericFilterCondition=property%3Aparent_in-list_&genericFilterConfiguration=defaultConfiguration

Expected Behavior

URL: http://localhost:8080/users?genericFilterCondition=property%3Aparent_in-list_&genericFilterConfiguration=defaultConfiguration

Sample Project

jmixtest.zip

Temporary workaround:

Extend io.jmix.flowui.view.navigation.RouteSupport, override io.jmix.flowui.view.navigation.RouteSupport#setQueryParameters method:

    @Override
    public void setQueryParameters(UI ui, QueryParameters queryParameters) {
        Page page = ui.getPage();

        String locationString = ui.getActiveViewLocation().getPath();
        Location newLocation = new Location(locationString, queryParameters);

        log.debug("Replace URL state with new location: {}", newLocation.getPathWithQueryParameters());
        page.getHistory().replaceState(null, newLocation);
    }

P.S.
It is not yet entirely clear whether it is safe to use location from a servlet.
See the 6cf26f5 commit.

@KremnevDmitry KremnevDmitry added type: bug Something isn't working size: M in: flowui triage Issue is waiting for triage labels Aug 28, 2024
@glebfox glebfox removed the triage Issue is waiting for triage label Aug 30, 2024
@MeyersJeff
Copy link

This problem was also reported in this forum post. The primary symptom we see is when the user opens a detail view, then returns to the list view, the wrong view is displayed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: flowui size: M type: bug Something isn't working
Projects
Status: Review
Development

Successfully merging a pull request may close this issue.

3 participants