This commit is contained in:
paul2212
2026-03-18 18:41:01 +01:00
parent c9de6af83b
commit 1243e1f8c5
4 changed files with 23 additions and 15 deletions

View File

@@ -5,6 +5,17 @@ All notable changes to this project are documented in this file.
The format is based on Keep a Changelog and this project uses Semantic Versioning.
## [0.1.35] - 2026-03-18
### Fixed
- **Web UI**: Fixed "body stream already read" error by reading response body only once.
- **Web UI**: Improved response handling to avoid double-reading response stream.
- **Web UI**: Better error messages for server-side 500 errors from scan endpoint.
### Changed
- **Web UI**: Refactored response handling to use single response.read() call.
- **Web UI**: Enhanced error display for server-side scan failures.
## [0.1.34] - 2026-03-18
### Fixed

View File

@@ -1,5 +1,5 @@
name: "Fichero Printer"
version: "0.1.34"
version: "0.1.35"
slug: "fichero_printer"
description: "REST API for the Fichero D11s (AiYin) thermal label printer over Bluetooth"
url: "https://git.leuschner.dev/Tobias/Fichero"

View File

@@ -77,7 +77,7 @@ async def lifespan(app: FastAPI): # noqa: ARG001
app = FastAPI(
title="Fichero Printer API",
description="REST API for the Fichero D11s (AiYin) thermal label printer.",
version = "0.1.34",
version = "0.1.35",
lifespan=lifespan,
docs_url=None,
redoc_url=None,
@@ -155,24 +155,21 @@ def _ui_html() -> str:
try {
const response = await fetch('scan');
if (!response.ok) {
try {
const error = await response.json();
throw new Error(error.detail || `HTTP error! status: ${response.status}`);
} catch (e) {
const text = await response.text();
throw new Error(`HTTP error! status: ${response.status}, response: ${text}`);
}
}
let devices;
let responseData;
try {
devices = await response.json();
responseData = await response.json();
} catch (e) {
const text = await response.text();
throw new Error(`Invalid JSON response: ${text}`);
}
if (!response.ok) {
const errorDetail = responseData.detail || `HTTP error! status: ${response.status}`;
throw new Error(errorDetail);
}
const devices = responseData;
if (devices.length === 0) {
resultsEl.textContent = '📡 No BLE devices found.\n\nTroubleshooting tips:\n- Make sure your printer is powered on\n- Ensure Bluetooth is enabled on this device\n- Bring the printer closer (within 5 meters)\n- Try restarting the printer';
} else {

View File

@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "fichero-printer"
version = "0.1.34"
version = "0.1.35"
description = "Web GUI, Python CLI, and protocol documentation for the Fichero D11s thermal label printer."
readme = "README.md"
requires-python = ">=3.10"