Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ Versionen folgen [Semantic Versioning](https://semver.org/lang/de/).

## [Unreleased]

## [0.16.1]

### Fixed
- **KoSIT-Validator: `IOException: Unzulässige Funktion` auf Windows.** Der KoSIT-Validator prüft via `FileInputStream.available()`, ob seine stdin gepiped ist (`Validator.isPiped()`). Auf Windows wirft `available()` für character devices (geerbtes Console-Handle, auch `NUL` via `Stdio::null()`) eine `IOException` — KoSIT fängt das nicht und bricht ab, bevor überhaupt ein Report geschrieben wird. Folge: jede Validierung im Dev-Modus und auch in der installierten App lieferte „Kein Report gefunden. stderr: java.io.IOException: Unzulässige Funktion". Fix in `src-tauri/src/validator.rs`: stdin wird jetzt aus einer leeren regulären Datei gefüttert (disk-type-Handle, `available()` liefert sauber 0, `isPiped()` wird false). Datei wird pro Validierungs-Aufruf im Temp-Verzeichnis angelegt und sofort wieder aufgeräumt.

## [0.16.0]

> **Internationalisierung + Detail-Schliff.** Englische PDF-Variante, mehrsprachige Katalog-Beschreibungen, kuratierte Ausgaben-Kategorien mit SKR03/SKR04-Konten-Mapping, und Bulk-Aktionen jetzt auch für Angebote und Eingangsrechnungen.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zettel",
"version": "0.16.0",
"version": "0.16.1",
"description": "Offline-first invoice generator with ZUGFeRD/Factur-X support",
"type": "module",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "zettel"
version = "0.16.0"
version = "0.16.1"
description = "Zettel — Offline-first invoice generator"
authors = ["Jonas Laux"]
edition = "2021"
Expand Down
13 changes: 12 additions & 1 deletion src-tauri/src/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use crate::sidecar;
use serde::Serialize;
use std::path::{Path, PathBuf};
use std::process::Command;
use std::process::{Command, Stdio};
use tauri::{AppHandle, Manager};

#[derive(Debug, Serialize)]
Expand Down Expand Up @@ -175,6 +175,15 @@ pub async fn validate_einvoice_xml(
std::fs::create_dir_all(&tmp).map_err(|e| format!("tmpdir: {}", e))?;

let java = resolve_java(&app);
// KoSIT prüft `FileInputStream.available()` um stdin-Pipe-Mode zu erkennen.
// Auf Windows wirft `available()` für character devices (Console-Handle,
// NUL) eine `IOException: Unzulässige Funktion` — `Stdio::null()` reicht
// also nicht. Wir reichen eine leere reguläre Datei rein: disk-type ist
// pollbar, `available()` liefert sauber 0, `isPiped()` wird false.
let empty_stdin = tmp.join("empty-stdin");
std::fs::write(&empty_stdin, b"").map_err(|e| format!("empty stdin write: {}", e))?;
let stdin_file =
std::fs::File::open(&empty_stdin).map_err(|e| format!("empty stdin open: {}", e))?;
let output = Command::new(&java)
.arg("-jar")
.arg(&jar)
Expand All @@ -185,13 +194,15 @@ pub async fn validate_einvoice_xml(
.arg("-o")
.arg(&tmp)
.arg(input)
.stdin(Stdio::from(stdin_file))
.output()
.map_err(|e| {
format!(
"Konnte Java nicht starten ({}). Ist eine JRE installiert?",
e
)
})?;
let _ = std::fs::remove_file(&empty_stdin);

// Validator returns non-zero on rejected input but still writes a report.
let stderr = String::from_utf8_lossy(&output.stderr);
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "Zettel",
"version": "0.16.0",
"version": "0.16.1",
"identifier": "digital.laux.zettel",
"build": {
"beforeDevCommand": "pnpm dev",
Expand Down
Loading