petio-team / petio

Petio Request, Discover, Review
https://petio.tv
MIT License
251 stars 28 forks source link

Radarr/Sonarr config breaks if `Base URL` does not have a preceding slash `/` #360

Closed nipuna-perera closed 3 years ago

nipuna-perera commented 3 years ago

Describe the bug When setting up Radarr and Sonarr settings, if the user has a base URL it is a required field. However, there is no indication whether the preceding forward-slash is required or pre-pended automatically. If the user does not provide the slash like /radarr or /sonarr, when they re-visit the settings by clicking on Edit on either Sonarr or Radarr agent the UI breaks and shows a blank page

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Admin console'
  2. Click on 'Settings'
  3. In either Radarr or Sonarr tabs click on edit
  4. See blank page with the dev console showing the following error
TypeError: this.state.profiles.map is not a function
    at s.value (radarr.js:406)
    at Va (react-dom.production.min.js:182)
    at Ba (react-dom.production.min.js:181)
    at Ou (react-dom.production.min.js:263)
    at mc (react-dom.production.min.js:246)
    at yc (react-dom.production.min.js:246)
    at uc (react-dom.production.min.js:239)
    at react-dom.production.min.js:123
    at t.unstable_runWithPriority (scheduler.production.min.js:19)
    at Go (react-dom.production.min.js:122)

Expected behavior Either a validation message enforcing the preceding slash or auto append when the user does not provide one.

Additional context petio version 0..4.5-alpha

ADRFranklin commented 3 years ago

Hi, could you try the dev version for us as I believe this has already been addressed in a more recent commit.

nipuna-perera commented 3 years ago

Hi @ADRFranklin, I tried on the dev image. 0.5.1-alpha. As soon as I remove the preceding / it breaks the same way. Blank screen and same JS error in console

ADRFranklin commented 3 years ago

Okay, thanks. We will try to resolve this soon.

AshDyson commented 3 years ago

Noted and fix planned