---
title: Tech debt
summary: CRITICAL and HIGH severity findings from analysis.
status: draft
owner: SAIF.Core documentation
last_reviewed: 2026-09-24
---

# Tech debt

`PDFService` is compiled and wrapped but not called end-to-end by any code path in this repository; the findings below cover resilience and correctness gaps in the wrapper that would surface as soon as a caller is added.

## CRITICAL

*(none identified)*

## HIGH

| Finding | Component | Impact | Recommended action |
| --- | --- | --- | --- |
| The wrapper `PdfServiceProxy` has no caller anywhere in this repository | `Services/SAIF.Services.Web.Proxies/PDFServiceProxy.cs` | The generated proxy and the wrapper are compiled and shipped in the `SAIF.Services.Web.Proxies` package but provide no in-repository value; the code is dead weight from this repository's perspective | Confirm whether an external consumer of the shipped package uses this wrapper; if not, consider removing it |
| `MaxReceivedMessageSize` and `ReaderQuotas.MaxArrayLength` are both set to `int.MaxValue` | `PDFServiceProxy.cs:22-23` | Removes the guard that protects the process from an oversized response | Set explicit, bounded limits appropriate to the largest expected document image |
| No client-side timeout, retry, or cancellation is configured at the call site | `PDFServiceProxy.cs:20-42` | A hung or slow remote call has no bound, and a transient failure is not retried | Configure an explicit `BasicHttpBinding` timeout and add a retry policy at the call site or in a consuming wrapper |
| `Close()` is called without an `Abort()` fallback on a faulted channel | `PDFServiceProxy.cs:59-67` | A faulted channel throws `CommunicationObjectFaultedException` from `Dispose()`, masking the original failure | Add a fault-aware disposal pattern (`Abort()` when the channel is faulted, `Close()` otherwise) |
| In-band failure signal `PDFCacheResult.Result` (`LoadDocumentResult`) and `Messages` are never inspected | `PDFServiceProxy.cs:42-45` | A caller of `GetImage` receives `File` (possibly `null`) with no indication that the remote service reported `Error_AccessDenied`, `Error_Processing`, or a timeout | Inspect `Result` and throw or surface a typed failure when it is not `Success_Loaded` |
| No null check on the SOAP response before reading `result.File` | `PDFServiceProxy.cs:45` | A `null` result throws an unhandled `NullReferenceException` instead of a descriptive failure | Add a null check and raise a descriptive exception |
| `DataUser = "IMG"` and `CachePriority = 10000` are hard-coded | `PDFServiceProxy.cs:36-37` | Every caller is forced to the same data-user label and cache priority regardless of context | Expose these as parameters if callers need to vary them |
| The candidate environment key is inconsistently cased (`legacyPdfServiceUrl` vs. `legacypdfServiceUrl`) across tracks, and is not read by any repository source | `Services/SAIF.Services.WebApi/EnvironmentApi/App_Data/environments.xml` | Whether a case-sensitive lookup would resolve the key is unknown**; the key is unused regardless | Normalize the casing and, if this proxy is intended to be wired up, read the key explicitly |

## Related documentation
- [Client index](index.md)
- [Overview](overview.md)
- [Architecture](architecture.md)
- [Contract](contract.md)
- [Operation map](operation-map.md)
- [Client reference](reference.md)
- [Consumption](consumption.md)
- [Dependencies](dependencies.md)

> **Note:** Statements marked with `**` could not be confirmed; treat as unknown
> until verified.

## Sources
- `Services/SAIF.Services.Web.Proxies/PDFServiceProxy.cs`
- `Services/SAIF.Services.WebApi/EnvironmentApi/App_Data/environments.xml`
