adobe / aem-spa-page-model-manager

Interface between Adobe Experience Manager and Single Page Application framework.
Apache License 2.0
34 stars 24 forks source link

[bug] The Page Model Manager should not attempt to fetch the model of an anchor URL #39

Closed pfauchere closed 3 years ago

pfauchere commented 3 years ago

Describe the bug

Following up on the issue initially reported in [0].

In [1], anchor URLs get processed to potentially fetch a model. The anchor chunk of the URL is kept when it should probably not be. This results in a regex not to perform well. But this is more a side effect. Stripping or ignoring the anchor chunk is probably the actual expectation. I such a case, we probably are interested in fetching the model of the page.

[0] https://github.com/adobe/aem-angular-editable-components/issues/33 [1] https://github.com/adobe/aem-spa-page-model-manager/blob/3ea346c82a107cef310d37d738e267d895fe805a/src/PathUtils.ts#L245

Package version Provide a package version where the bug occurs.

To Reproduce Steps to reproduce the behavior:

Try to navigate to a URL of the SPA that contains an anchor chunk

e.g. my-website/my-page#anchor

Experienced behavior

The following illegitimate URL is generated:

my-website/my-page#anchor.model

Expected behavior A clear and concise description of what you expected to happen.

The following URL should be generated instead

my-website/my-page.model

Screenshots If applicable, add screenshots to help explain your problem.

See: https://github.com/adobe/aem-angular-editable-components/issues/33

Additional context Add any other context about the problem here.