Excessive version checking #537

Open
opened 2024-04-07 03:23:47 +02:00 by Crimekillz · 1 comment
Contributor

The way how version checking is implemented, is that if an user that happens to be admin loads any page, even non-administrative pages like their timeline, an API request is fired to
https://iceshrimp.dev/api/v1/repos/iceshrimp/iceshrimp/releases?draft=false&page=1&limit=1

I feel this may be a bit excessive.

The corresponding request also assumes that the response "makes sense" and fails in a non-flattering way if the GIT were to be in maintenance mode or unreachable.

iceshrimp_web | ERR 1 [api] Internal error occurred in latest-version: Cannot read properties of undefined (reading 'tag_name')

See attached patch to remedy this behavior if this is unintended.
Updates will now only be checked when the admin page is invoked.

The way how version checking is implemented, is that if an user that happens to be admin **loads any page**, even non-administrative pages like their timeline, an API request is fired to https://iceshrimp.dev/api/v1/repos/iceshrimp/iceshrimp/releases?draft=false&page=1&limit=1 I feel this may be a bit excessive. The corresponding request also assumes that the response "makes sense" and fails in a non-flattering way if the GIT were to be in maintenance mode or unreachable. `iceshrimp_web | ERR 1 [api] Internal error occurred in latest-version: Cannot read properties of undefined (reading 'tag_name')` See attached patch to remedy this behavior if this is unintended. Updates will now only be checked when the admin page is invoked.
Owner

This is required given the current way the update checker works (specifically, the badge on the control panel button requires this). It should only be loaded once per SPA refresh though, and not every time you navigate to a different page.

This is required given the current way the update checker works (specifically, the badge on the control panel button requires this). It should only be loaded once per SPA refresh though, and not every time you navigate to a different page.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: iceshrimp/iceshrimp#537
No description provided.