Open audiodude opened 1 year ago
Not clear to me what are the reproduction steps or even the user impact. Hopefuly not too bad.
Steps to reproduce:
Expected Result:
The page for creating a new selection loads, empty and ready for data.
Actual Result:
A 404 error occurs when the page erroneously tries to load the selection with ID undefined
.
@audiodude Thx, indeed I confirm:
This appears to be caused by the
watch
property of the component, which is watching thebuilderId
property and callingthis.getBuilder()
inBaseBuilder
here: https://github.com/openzim/wp1/blob/main/wp1-frontend/src/components/BaseBuilder.vue#L251However, putting a guard clause on that method call doesn't fully resolve the issue. It avoids the 404, but the page still loads with the previous builder's information filled out in the form fields. For some reason, the BaseBuilder component is being reused, even though we are navigating to a new route. Vue Navigation Guards don't help here, because they never fire (since Vue thinks it's going to a new route).
It's unclear why Vue both treats this as a new route (which it is, as seen here) and yet still re-uses the component.