fix(fleet): strip trailing slash in fetchRemoteMeta URL construction (#444)

Nodes with a trailing slash in api_url (e.g. http://host:3000/) caused
fetchRemoteMeta to construct a double-slash URL (http://host:3000//api/meta),
which failed silently. The update-status endpoint then returned version: null
for the remote node, triggering a false "Update available" badge.

Every other URL construction in the codebase already strips the trailing
slash; this was the one call site that was missed.
This commit is contained in:
Anso
2026-04-08 17:08:39 -04:00
committed by GitHub
parent 8d5bde6a8c
commit 8080540881
2 changed files with 7 additions and 1 deletions
+6
View File
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Fixed
* **fleet:** fix false "Update available" on remote nodes whose `api_url` has a trailing slash, causing `fetchRemoteMeta` to construct a double-slash URL that fails silently
## [0.41.1](https://github.com/AnsoCode/Sencho/compare/v0.41.0...v0.41.1) (2026-04-08)
+1 -1
View File
@@ -93,7 +93,7 @@ export function getActiveCapabilities(): readonly string[] {
/** Fetch /api/meta from a remote Sencho instance. Returns empty data on failure. */
export async function fetchRemoteMeta(baseUrl: string, apiToken: string): Promise<RemoteMeta> {
try {
const res = await axios.get(`${baseUrl}/api/meta`, {
const res = await axios.get(`${baseUrl.replace(/\/$/, '')}/api/meta`, {
headers: { Authorization: `Bearer ${apiToken}` },
timeout: 5000,
});