revanced-website icon indicating copy to clipboard operation
revanced-website copied to clipboard

feat: API status banner

Open Ushie opened this issue 2 years ago • 8 comments

Display a banner at the top of the webpage if the API is down/inaccessible

Ushie avatar Oct 19 '23 21:10 Ushie

The API is inaccessible if it timeouts or returns anything other than a non-OK response. In both cases, a dedicated banner message should be shown. In addition to the API being down, an offtopic idea can be to cache API responses in case the API is inaccessible.

oSumAtrIX avatar Jan 08 '24 00:01 oSumAtrIX

From what I understand this isn't a simple change. There is no centralized place or store to check the status from. It might require wrapping every API call or something.

KTibow avatar Jan 16 '24 14:01 KTibow

We have this https://api.revanced.app/v2/ping endpoint which we can use, we can ping it on website initial load and check the status code

If the status code is unexpected, we can display a banner above the navbar

Ushie avatar Jan 16 '24 14:01 Ushie

Seems like the endpoint is currently broken, will open an issue in the API repository

Ushie avatar Jan 16 '24 14:01 Ushie

The API expects a HEAD request

oSumAtrIX avatar Jan 16 '24 14:01 oSumAtrIX

Right

Ushie avatar Jan 16 '24 14:01 Ushie

I think at the top is not the best choice, because if you add the element everything in the page is shifted downwards, and if you make the element fixed, it'll cover the navbar buttons. I think a fixed banner at the bottom of the page is ideal, even better with a close button which will keep it closed until the site is refreshed

madkarmaa avatar Aug 13 '24 05:08 madkarmaa

If the API is down the website won't work as expected & if the banner is at the bottom it wont be noticed, especially on mobile. Additionally, eventually with announcements being shown on Website, for the latest one, we would reuse the banner to display the announcement & if the banner would be at the bottom, it would be inconsistent, since announcements would be shown at the top, or if at the bottom, go unnoticed once again

oSumAtrIX avatar Aug 13 '24 05:08 oSumAtrIX