fiskaltrust / fiskaltrust/middleware
CustomRTServer: async default (SendReceiptsSync=false) risks fiscal-document loss on stateless/cloud hosts
- Dominant language
- C#
- Stars
- 20
- Forks
- 11
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 13
Description
## Problem
`CustomRTServer` defaults `SendReceiptsSync=false` (**async**). In async mode it buffers pending commercial documents to a local disk cache that falls back to `SpecialFolder.Personal` when no `ServiceFolder`/`CacheDirectory` is configured. On **CloudCashbox** (stateless, no persistent volume; `SpecialFolder.Personal` resolves to `/root` — writable but ephemeral), those buffered documents are **lost on pod restart/recycle**.
This is live **today** unless every cloud CustomRTServer cashbox config explicitly sets `sendreceiptssync=true`. Same bug class as the EpsonRTServer incident, on a shipped SCU.
## Evidence
- Default: `CustomRTServerConfiguration.SendReceiptsSync` = `false` — `scu-it/src/fiskaltrust.Middleware.SCU.IT.CustomRTServer/CustomRTServerConfiguration.cs:11`
- `SpecialFolder.Personal` fallback: `scu-it/src/fiskaltrust.Middleware.SCU.IT.CustomRTServer/CustomRTServerCommunicationQueue.cs:36-55`
- Hosted in the same factory as EpsonRTServer: `service-cloudcashbox` `SingletonIITSSCDClientFactory`
## Why NOT to blanket-copy the EpsonRTServer fix
The EpsonRTServer fix (middleware #716 + service-cloudcashbox #132) forces sync on cloud and requires an explicit durable folder for async. Do **not** copy it verbatim to CustomRTServer:
- On **Android**, CustomRTServer's `Personal` fallback is **load-bearing durable storage** (no launcher-injected `servicefolder`, unlike the DE providers). Removing it would break async there.
- Forcing `SendReceiptsSync=true` for **live** CustomRTServer cloud cashboxes changes latency/availability semantics → needs product sign-off.
## Suggested actions
1. Audit production cloud CustomRTServer cashbox configs for `sendreceiptssync`.
2. If forcing sync on cloud, mirror #132's host-side `SendReceiptsSync=true` injection **scoped to CustomRTServer** (after product sign-off).
3. Ensure a durable `servicefolder` is injected for CustomRTServer on **Android** before touching its `Personal` fallback.
Refs: middleware #716, service-cloudcashbox #132 (the EpsonRTServer equivalents).
Contributor guide
Research direction
Start with scu-it/src/fiskaltrust.Middleware.SCU.IT.CustomRTServer/CustomRTServerConfiguration.cs and CustomRTServerCommunicationQueue.cs to confirm the async default and Personal-folder fallback. Audit production CloudCashbox configurations for sendreceiptssync, then compare middleware #716 and service-cloudcashbox #132. Done means an agreed, scoped cloud/Android approach that avoids ephemeral storage loss without breaking Android durability.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend, cloud, infrastructure, mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100