Skip to content

PB-447: legacy parser not switching to map view#825

Merged
ltkum merged 6 commits intodevelopfrom
bugfix-PB-447-broken-legacy-parser
May 21, 2024
Merged

PB-447: legacy parser not switching to map view#825
ltkum merged 6 commits intodevelopfrom
bugfix-PB-447-broken-legacy-parser

Conversation

@ltkum
Copy link
Contributor

@ltkum ltkum commented May 7, 2024

Issue : in some occasions, the router plugins would process the legacy query correctly, but not switch to the map view once it was done, staying stuck in the legacy view forever and not showing anything.

This happened when there was no change to make to the query due to default parameters not being in the URL, but still needing a redirect to the map view.

Fix : If we change the store and the view should change, we ask for a query change too

Test link

@ltkum ltkum requested a review from pakb May 7, 2024 09:33
@github-actions github-actions bot added the bug label May 7, 2024
@ltkum ltkum force-pushed the bugfix-PB-447-broken-legacy-parser branch 3 times, most recently from bd0a434 to 40fe1fb Compare May 7, 2024 11:55
@cypress
Copy link

cypress bot commented May 7, 2024

Passing run #2226 ↗︎

0 206 20 0 Flakiness 0

Details:

PB-447: PR review and logs cleanup
Project: web-mapviewer Commit: 5e509c3ed4
Status: Passed Duration: 05:15 💡
Started: May 21, 2024 4:14 PM Ended: May 21, 2024 4:19 PM

Review all test suite changes for PR #825 ↗︎

let routeChangeIsTriggeredByThisModule = false

// flag to tell us if we need to enforce a query redirection when coming from the legacy router
let needRouteChangeBecauseOfLegacy = true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure it's a good idea to set it to true by default.
Maybe it should be set to true the first time we enter the LegacyView. If I understand correctly the goal here is to make sure we exit this view, so it would make more sense this way (here I fear it will trigger something unwanted when entering the normal MapView...)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would make more sense. Functionally there is no real issue (the map view will go through the router one additional time, but it won't crash or go infinite), but it would be cleaner to only do it when we went through the legacy router first.

@ltkum ltkum force-pushed the bugfix-PB-447-broken-legacy-parser branch from 40fe1fb to 2156ed9 Compare May 13, 2024 11:20
@ltkum ltkum requested review from ltshb and pakb May 13, 2024 12:02
Copy link
Contributor

@ltshb ltshb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this is a good solution, looking at the code we should not have a problem, somehow we need to debug the vue router navigation guards

@ltkum ltkum force-pushed the bugfix-PB-447-broken-legacy-parser branch 4 times, most recently from 43cc43f to 308b33b Compare May 21, 2024 12:07
ltkum added 4 commits May 21, 2024 14:12
Issue : in some occasions, the router plugins would process the legacy query correctly, but not switch to the map view once it was done, staying stuck in the legacy view forever and not showing anything.

This happened when there was no change to make to the query due to default parameters not being in the URL, but still needing a redirect to the map view.

Fix : If we change the store and the view should change, we ask for a query change too
We need to be able to send the router to a 'next' route in some rare instances where the legacy parser was called, but there was no default parameter at all.
To do this, we use an app parameter which is set to true by the legacy parser, and set to false the moment the store sync router makes a redirect.

Also adding some debug logs
removing development logs

moving logs where it makes sense to have them
@ltkum ltkum force-pushed the bugfix-PB-447-broken-legacy-parser branch 3 times, most recently from 13d419a to e17b5e9 Compare May 21, 2024 13:52
…egacy view

PB-447: removing legacy Usage checker

linting

log level change
@ltkum ltkum force-pushed the bugfix-PB-447-broken-legacy-parser branch from e17b5e9 to 4f97491 Compare May 21, 2024 14:03
@ltkum ltkum requested a review from ltshb May 21, 2024 14:21
Copy link
Contributor

@ltshb ltshb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some minor comments.

@ltkum ltkum merged commit 05d4b03 into develop May 21, 2024
@ltkum ltkum deleted the bugfix-PB-447-broken-legacy-parser branch May 21, 2024 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants