hassio-addons / addon-grocy

Grocy - Home Assistant Community Add-ons
https://addons.community
MIT License
319 stars 60 forks source link

Create product from Inventory screen, or change language, takes you to a 404 page #409

Closed igorsantos07 closed 3 months ago

igorsantos07 commented 11 months ago

Problem/Motivation

When you create a product from the Inventory screen, it continues into a 404 page. Also, if you go to User Settings (at the :wrench: on the corner) and change the language, you're also redirected to a 404.

I think this happens somewhere else as well, but I can't remember right now the other screen.

Expected behavior

I tested this in the live Grocy demo and it takes you back to the Inventory page, as expected. I'm not sure if the problem is because in HA it runs on a subpath.

Actual behavior

It looks like a root path problem; the redirect in my instance goes to http://hass.local:8123/api/hassio_ingress/tBExf64mMbmSzXstfKLypj9J46CeBeoT1HMJZ-DIgX4//api/hassio_ingress/tBExf64mMbmSzXstfKLypj9J46CeBeoT1HMJZ-DIgX4/inventory?flow=InplaceNewProductWithName&&product-name=teste%202 (note the repeated /api/hassio_ingress)

Steps to reproduce

  1. go to Inventory
  2. write a non-existing product on the first field
  3. press enter
  4. a popup shows up; select "add as new product"
  5. fill in any required fields on the "new product" screen
  6. press "save & continue"
  7. get sent to a 404 page

Proposed changes

I wonder if it's a problem of redirecting to a relative path (and thus, should be fixed in core Grocy), or related to the patches made in the add-on (as pointed by the veeery kind maintainer at https://github.com/grocy/grocy/issues/2379)

igorsantos07 commented 11 months ago

After stumbling upon Grocy's config file, I wonder if the initial patch from #157 couldn't be better handled by using either BASE_URL, BASE_PATH or even DISABLE_URL_REWRITING... Although those options seem to exist (2018, 2020) way before #157 (2021) and the mention of a "brain-damaged handling of relative URLs" seems to make sense lol

igorsantos07 commented 10 months ago

stale-proof comment

github-actions[bot] commented 9 months ago

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!

igorsantos07 commented 8 months ago

stale-proof comment

github-actions[bot] commented 7 months ago

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!

igorsantos07 commented 7 months ago

stale-proof comment

github-actions[bot] commented 6 months ago

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!

igorsantos07 commented 6 months ago

stale-proof comment

github-actions[bot] commented 5 months ago

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!

igorsantos07 commented 5 months ago

stale-proof comment

github-actions[bot] commented 3 months ago

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!