When a POST to avoid wasting a schedule instances out in Invoke-WebRequest, test the saved document earlier than deciding whether or not to ship the request once more. This native lab makes use of the unique operation ID for that test. After saving the server and consumer under, run pwsh -NoProfile -File ./consumer.ps1.
Within the recorded LostResponse run, the API saved the schedule earlier than PowerShell reported a timeout. Repeating the POST would have created one other schedule. A GET with the unique operation ID confirmed the saved write.
The API solely shops configuration for a nightly stock export; it would not run the export. Misplaced-response mode intentionally saves the schedule and withholds the response. You may examine the consumer consequence with the saved row, together with circumstances the place the consumer cannot verify an present write.
Affirm the write earlier than persevering with
An Invoke-WebRequest error describes what the consumer noticed. The server might have already got dedicated the write. HTTP’s idempotency guidelines clarify why a communication failure alone would not justify repeating a non-idempotent request.
The consumer saves the operation ID and meant payload, then sends one POST. Solely a 201 response containing that precise dedicated document confirms the write by way of the response.
If the POST would not verify the write, the consumer makes one GET for the unique ID. Solely 200 with the precise document confirms success. Each different API consequence leaves the result unknown. The consumer by no means repeats the POST robotically. Cease any automation that relies on an unconfirmed write.
Anticipated lost-response consequence
The consumer generates an operation ID by default. The recorded LostResponse run used a set ID and returned this entire object with exit 0:
{
"Consequence": "ConfirmedSuccess",
"ConfirmedBy": "Readback",
"OperationId": "f42a9b21-54ed-42ca-b21c-1b8c134af001",
"WriteStatus": null,
"WriteError": "System.Threading.Duties.TaskCanceledException: The request was canceled as a result of configured HttpClient.Timeout of three seconds elapsing.",
"ReadStatus": 200,
"ReadError": null,
"Purpose": "ExactCommittedRecord"
}
The GET confirmed the saved schedule, whereas WriteError saved the POST timeout. An impartial file test discovered the saved document whereas the consumer was nonetheless ready. When it completed, the request journal held one POST and one GET; the schedule file held one precise document.
To breed the run, begin the API, save the whole consumer, then test the consequence and saved schedule. A profitable HTTP standing alone would not verify the write; the response should additionally move the document acceptance guidelines.
Begin the API in terminal A
Use PowerShell 7.6, two terminals, a writable listing, and free loopback port 8765. The lab runs domestically and desires no modules or credentials.
The lab was run programmatically on macOS 26.3.2 ARM64 with PowerShell 7.6.9 and .NET 10.0.14. All six eventualities additionally matched the anticipated outcomes on Home windows with PowerShell 7.6.9. Linux, Home windows PowerShell 5.1, and the interactive two-terminal walkthrough weren’t examined.
In terminal A, begin PowerShell:
pwsh -NoProfile
On the new PowerShell immediate, create the lab folder:
$PSVersionTable.PSVersion
New-Merchandise -ItemType Listing -Path './api consequence lab'
Set-Location -LiteralPath './api consequence lab'
(Get-Location).Path
Obtain-Request information every request in requests.jsonl. Save-Schedule appends the brand new schedule to schedules.jsonl earlier than dealing with the response. The schedule can stay saved even when the response fails.
In LostResponse, Maintain-Response retains the unanswered HTTP context in reminiscence whereas the listener accepts extra requests. The consumer’s GET can then attain Learn-Operation and retrieve the saved schedule whereas the POST stays unanswered.
Save the whole server itemizing as server.ps1 in that folder:
param(
[Parameter(Mandatory)][string]$RunDirectory,
[ValidateSet('Normal', 'LostResponse', 'ReadbackUnavailable', 'ReadbackMissing',
'ReadbackMismatch', 'ReadbackLost')][string]$State of affairs = 'LostResponse',
[ValidateRange(1024, 65535)][int]$Port = 8765
)
$ErrorActionPreference="Cease"
Set-StrictMode -Model Newest
operate Ship-Json($Context, [int]$Standing, $Worth) ConvertTo-Json -Depth 6 -Compress))
$Context.Response.StatusCode = $Standing
$Context.Response.ContentType="software/json; charset=utf-8"
$Context.Response.ContentLength64 = $bytes.Size
$Context.Response.OutputStream.Write($bytes, 0, $bytes.Size)
$Context.Response.Shut()
operate Maintain-Response($Context) {
if ($held.Rely -ge 8) { throw 'Eight held responses reached. Cease this lab run.' }
$held.Add($Context)
}
operate Save-Schedule($Context, [string]$Physique) {
$request = $Physique | ConvertFrom-Json
$document = [ordered]@{
operationId = $request.operationId
state="dedicated"
payload = $request.payload
}
$line = $document | ConvertTo-Json -Depth 6 -Compress
[IO.File]::AppendAllText($schedulePath, $line + "`n")
$saved.Add($document)
if ($State of affairs -eq 'Regular') {
Ship-Json $Context 201 $document
return
}
Maintain-Response $Context
}
operate Learn-Operation($Context, [string]$Id) {
if ($State of affairs -eq 'ReadbackLost') { Maintain-Response $Context; return }
if ($State of affairs -eq 'ReadbackUnavailable') { Ship-Json $Context 503 @{}; return }
if ($State of affairs -eq 'ReadbackMissing') { Ship-Json $Context 404 @{}; return }
$matches = @($saved | The place-Object { $_.operationId -ceq $Id })
if ($matches.Rely -eq 0) { Ship-Json $Context 404 @{}; return }
if ($matches.Rely -ne 1) { Ship-Json $Context 409 @{}; return }
$document = $matches[0] | ConvertTo-Json -Depth 6 | ConvertFrom-Json
if ($State of affairs -eq 'ReadbackMismatch') { $document.payload.timeUtc="03:30" }
Ship-Json $Context 200 $document
}
operate Obtain-Request($Context) {
$reader = [IO.StreamReader]::new($Context.Request.InputStream, [Text.Encoding]::UTF8)
attempt { $physique = $reader.ReadToEnd() } lastly { $reader.Dispose() }
$methodology = $Context.Request.HttpMethod
$path = $Context.Request.RawUrl
$entry = @{ methodology = $methodology; path = $path; physique = $physique } | ConvertTo-Json -Compress
[IO.File]::AppendAllText($requestPath, $entry + "`n")
if ($methodology -ceq 'POST' -and $path -ceq '/schedules') {
Save-Schedule $Context $physique
return
}
if ($methodology -ceq 'GET' -and $path.StartsWith('/operations/', [StringComparison]::Ordinal)) {
Learn-Operation $Context $path.Substring(12)
return
}
Ship-Json $Context 404 @{}
}
$listing = New-Merchandise -ItemType Listing -Path $RunDirectory
$schedulePath = Be part of-Path $listing.FullName 'schedules.jsonl'
$requestPath = Be part of-Path $listing.FullName 'requests.jsonl'
$saved = [Collections.Generic.List[object]]::new()
$held = [Collections.Generic.List[object]]::new()
$listener = [Net.HttpListener]::new()
$listener.Prefixes.Add("http://127.0.0.1:$Port/")
attempt {
$listener.Begin()
Write-Output "READY http://127.0.0.1:$Port/ $State of affairs"
whereas ($listener.IsListening) {
$pending = $listener.GetContextAsync()
whereas (-not $pending.Wait(100)) { }
Obtain-Request $pending.GetAwaiter().GetResult()
}
} lastly {
foreach ($context in $held) { $context.Response.Abort() }
$listener.Shut()
}
Begin the server within the foreground:
pwsh -NoProfile -File ./server.ps1 -RunDirectory './run-lost' -State of affairs LostResponse
Look forward to READY http://127.0.0.1:8765/ LostResponse earlier than beginning the consumer. Startup fails if the run listing already exists or the port is busy. Use a contemporary run listing for every situation.
The server holds as much as eight responses; the subsequent tried maintain throws. A POST that reaches this restrict has already appended its schedule, and the error would not undo that write. This boundary hasn’t been runtime examined.
Save the intent in terminal B
Open a second terminal within the father or mother listing of the lab folder. Begin PowerShell:
pwsh -NoProfile
On the new PowerShell immediate, choose the lab folder:
Set-Location -LiteralPath './api consequence lab'
The highest-level $id and $intent block builds the operation ID and payload, then encodes them as UTF-8. It opens $IntentPath with [IO.FileMode]::CreateNew, writes the intent, and closes the file earlier than any community request. Each affirmation paths use this saved intent.
The default filename is intent.json. If it already exists, the consumer stops earlier than sending something. Rerunning the consumer will not robotically resume or resend an earlier intent.
A confirmed response or readback produces the complete ConfirmedSuccess object and exit 0. If a accomplished API test cannot verify the write, it returns Unknown and exit 2. Cease automation that relies on the write.
Save the whole itemizing as consumer.ps1 within the lab folder:
param(
[ValidateRange(1024, 65535)][int]$Port = 8765,
https://evotec.xyz/weblog/verify-uncertain-api-outcomes-powershell/$OperationId = https://evotec.xyz/weblog/verify-uncertain-api-outcomes-powershell/::NewGuid(),
[string]$IntentPath="./intent.json"
)
$ErrorActionPreference="Cease"
Set-StrictMode -Model Newest
operate Get-JsonString($Worth) {
if ($Worth -is [Text.Json.JsonElement]) {
if ($Worth.get_ValueKind().ToString() -ne 'String') { throw 'Anticipated a JSON string component' }
} elseif ($Worth -isnot [Text.Json.JsonProperty]) {
throw 'Anticipated a JSON string component or property'
}
attempt {
if ($Worth -is [Text.Json.JsonProperty]) { return $Worth.get_Name() }
return $Worth.GetString()
} catch [ObjectDisposedException] { throw }
catch [InvalidOperationException] {
throw [Text.DecoderFallbackException]::new('Can't decode supplier JSON string.', $_.Exception)
}
}
operate Take a look at-Fields($Component, [string[]]$Names) {
if ($Component.ValueKind.ToString() -ne 'Object') { return $false }
$anticipated = [Collections.Generic.HashSet[string]]::new($Names, [StringComparer]::Ordinal)
$seen = [Collections.Generic.HashSet[string]]::new([StringComparer]::Ordinal)
foreach ($property in $Component.EnumerateObject()) {
$title = Get-JsonString $property
if (-not $anticipated.Incorporates($title)) { return $false }
if (-not $seen.Add($title)) { return $false }
}
return $seen.Rely -eq $Names.Rely
}
operate Take a look at-StringFields($Component, [string[]]$Names) {
foreach ($title in $Names) {
if ($Component.GetProperty($title).ValueKind.ToString() -ne 'String') { return $false }
}
return $true
}
operate Get-RecordReason($Document) {
if (-not (Take a look at-Fields $Document @('operationId', 'state', 'payload'))) { return 'InvalidShape' }
if (-not (Take a look at-StringFields $Document @('operationId', 'state'))) { return 'InvalidShape' }
$payload = $Document.GetProperty('payload')
if (-not (Take a look at-Fields $payload @('job', 'timeUtc', 'enabled'))) { return 'InvalidShape' }
if (-not (Take a look at-StringFields $payload @('job', 'timeUtc'))) { return 'InvalidShape' }
if ($payload.GetProperty('enabled').ValueKind.ToString() -notin @('True', 'False')) {
return 'InvalidShape'
}
$precise = @((Get-JsonString ($Document.GetProperty('operationId'))), (Get-JsonString ($Document.GetProperty('state'))),
(Get-JsonString ($payload.GetProperty('job'))), (Get-JsonString ($payload.GetProperty('timeUtc'))))
$anticipated = @($id, 'dedicated', $intent.payload.job, $intent.payload.timeUtc)
for ($i = 0; $i -lt $anticipated.Rely; $i++) {
if (-not [string]::Equals($precise[$i], $anticipated[$i], [StringComparison]::Ordinal)) {
return 'RecordMismatch'
}
}
if ($payload.GetProperty('enabled').GetBoolean() -ne $intent.payload.enabled) { return 'RecordMismatch' }
return 'ExactCommittedRecord'
}
operate Get-ResponseReason($Response, [int]$ExpectedStatus) {
if ($null -eq $Response) { return 'TransportError' }
if ([int]$Response.StatusCode -ne $ExpectedStatus) { return "HttpStatus:$($Response.StatusCode)" }
attempt { $doc = [Text.Json.JsonDocument]::Parse([string]$Response.Content material) }
catch [Text.Json.JsonException] { return 'InvalidJson' }
attempt { return Get-RecordReason $doc.RootElement }
catch [Text.DecoderFallbackException] { return 'UndecodableString' }
lastly { $doc.Dispose() }
}
operate Get-RequestError($Failure) {
$exception = $Failure.Exception
$element = "$($exception.GetType().FullName): $($exception.Message)"
if ($Failure.FullyQualifiedErrorId -like 'MaximumRedirectExceeded,*') {
return "$element $($Failure.ErrorDetails.Message)"
}
foreach ($kind in @([Net.Http.HttpRequestException], [Threading.Tasks.TaskCanceledException], [TimeoutException])) {
if ($exception -is $kind) { return $element }
}
throw $Failure
}
$id = $OperationId.ToString('D')
$intent = @{ operationId = $id; payload = @{ job = 'inventory-export'; timeUtc="02:30"; enabled = $true } }
$json = $intent | ConvertTo-Json -Depth 4
$bytes = [Text.Encoding]::UTF8.GetBytes($json)
$file = [IO.File]::Open($IntentPath, [IO.FileMode]::CreateNew)
attempt { $file.Write($bytes, 0, $bytes.Size) } lastly { $file.Dispose() }
$choices = @{
MaximumRetryCount = 0
MaximumRedirection = 0
ConnectionTimeoutSeconds = 3
OperationTimeoutSeconds = 3
HttpVersion = '1.1'
DisableKeepAlive = $true
NoProxy = $true
SkipHttpErrorCheck = $true
ErrorAction = 'Cease'
}
$consequence = [ordered]@{
Consequence="Unknown"; ConfirmedBy = $null; OperationId = $id
WriteStatus = $null; WriteError = $null; ReadStatus = $null; ReadError = $null; Purpose = $null
}
$write = $null
attempt {
Invoke-WebRequest @choices -Uri "http://127.0.0.1:$Port/schedules" -Technique Put up `
-Physique $bytes -ContentType 'software/json; charset=utf-8' | ForEach-Object {
$write = $_
$consequence.WriteStatus = [int]$_.StatusCode
}
} catch {
$consequence.WriteError = Get-RequestError $_
}
$consequence.Purpose = Get-ResponseReason $write 201
if ($consequence.Purpose -eq 'ExactCommittedRecord') {
$consequence.ConfirmedBy = 'Response'
} else {
$learn = $null
attempt {
Invoke-WebRequest @choices -Uri "http://127.0.0.1:$Port/operations/$id" -Technique Get | ForEach-Object {
$learn = $_
$consequence.ReadStatus = [int]$_.StatusCode
}
} catch {
$consequence.ReadError = Get-RequestError $_
}
$consequence.Purpose = Get-ResponseReason $learn 200
if ($consequence.Purpose -eq 'ExactCommittedRecord') { $consequence.ConfirmedBy = 'Readback' }
}
if ($null -ne $consequence.ConfirmedBy) ConvertTo-Json
exit 0
[pscustomobject]$consequence | ConvertTo-Json
exit 2
One Invoke-WebRequest POST sends the saved bytes. If the request throws, Get-RequestError retains the native exception kind and message for anticipated transport failures. It rethrows sudden native errors. A timeout tells you what the consumer noticed; the server should have saved the schedule.
Get-ResponseReason $write 201 first requires standing 201. It then calls Get-RecordReason to match the response with the intent. The unique ID, state dedicated, and meant payload should all match to return ExactCommittedRecord. A distinct document cannot verify this write, even with standing 201.
If the response would not verify the write, the consumer makes one GET to /operations/$id utilizing the unique ID. Get-ResponseReason $learn 200 requires standing 200 and an actual match for the anticipated document. This readback can verify the saved write with out one other POST or a brand new operation ID.
The web-command timeout settings restrict totally different waits. ConnectionTimeoutSeconds bounds a pending request; OperationTimeoutSeconds limits a stalled stream learn. Each are three seconds right here. Neither limits the entire script’s runtime or tells the server to roll again. Standing-based retries and redirects are disabled.
SkipHttpErrorCheck lets the consumer examine an HTTP error response with out throwing on its standing. Affirmation nonetheless requires the anticipated standing and precise document. See PowerShell’s terminating-error dealing with for a way request errors attain catch and Get-RequestError.
Examine the consequence and the saved schedule
Run the consumer as soon as in terminal B, then examine its consequence and each server recordsdata:
pwsh -NoProfile -File ./consumer.ps1
$clientExit = $LASTEXITCODE
"Shopper exit: $clientExit"
$intent = Get-Content material -LiteralPath './intent.json' -Uncooked | ConvertFrom-Json
Get-Content material -LiteralPath './run-lost/schedules.jsonl' | ConvertFrom-Json | Format-Checklist
Get-Content material -LiteralPath './run-lost/requests.jsonl' | ConvertFrom-Json | Choose-Object methodology, path
Examine your consequence with the full lost-response consequence under the diagram. Earlier than automation accepts success, require a accomplished invocation with the complete ConfirmedSuccess object for the unique operation ID and native exit 0. Exit 0 alone is not sufficient.
Examine the server recordsdata with intent.json. Rely requests and saved rows individually: ConfirmedSuccess would not let you know what number of schedules had been created. This run ought to have one POST to /schedules and one GET to /operations/ adopted by the unique $intent.operationId. The saved document should comprise that ID, state dedicated, and payload values job: inventory-export, timeUtc: 02:30, and Boolean enabled: true.
A saved row can coexist with a 404
In ReadbackMissing, the server saves the precise schedule however returns 404 to the consumer’s GET. Begin a contemporary run to examine the saved row alongside the consumer consequence.
Cease the server with Ctrl+C in terminal A. The lastly block closes the listener and held responses. The recordsdata stay obtainable to examine. Begin the missing-readback situation:
pwsh -NoProfile -File ./server.ps1 -RunDirectory './run-missing' -State of affairs ReadbackMissing
Run the consumer as soon as in terminal B with a brand new intent filename:
pwsh -NoProfile -File ./consumer.ps1 -IntentPath './intent-missing.json'
$LASTEXITCODE
Get-Content material -LiteralPath './run-missing/schedules.jsonl'
The recorded consumer consequence was Unknown, ReadStatus: 404, Purpose: HttpStatus:404, and exit 2. The schedule file nonetheless held the precise saved document. The lab hides that document from the learn path, so its 404 would not set up rollback.
Earlier than treating a lacking document as proof that no write occurred, test the API’s documented learn consistency and operation-retention ensures.
All six recorded runs saved one row. The consumer stayed at Unknown when the GET returned 503, 404, a 200 document with the improper time, or no response earlier than timeout. Cease the server and use a contemporary run listing and intent filename for every further situation.
Counts are POST / GET / saved rows.
| State of affairs | POST | GET | Consequence / exit | Counts |
|---|---|---|---|---|
Regular |
Precise 201 |
Not requested | Confirmed by response / 0 |
1 / 0 / 1 |
LostResponse |
Timeout | Precise 200 |
Confirmed by readback / 0 |
1 / 1 / 1 |
ReadbackUnavailable |
Timeout | 503 |
Unknown / 2 |
1 / 1 / 1 |
ReadbackMissing |
Timeout | 404 |
Unknown / 2 |
1 / 1 / 1 |
ReadbackMismatch |
Timeout | 200, improper time |
Unknown / 2 |
1 / 1 / 1 |
ReadbackLost |
Timeout | Timeout | Unknown / 2 |
1 / 1 / 1 |
The ReadbackLost run exited with code 2 and returned this object.
{
"Consequence": "Unknown",
"ConfirmedBy": null,
"OperationId": "f42a9b21-54ed-42ca-b21c-1b8c134af001",
"WriteStatus": null,
"WriteError": "System.Threading.Duties.TaskCanceledException: The request was canceled as a result of configured HttpClient.Timeout of three seconds elapsing.",
"ReadStatus": null,
"ReadError": "System.Threading.Duties.TaskCanceledException: The request was canceled as a result of configured HttpClient.Timeout of three seconds elapsing.",
"Purpose": "TransportError"
}
Purpose reviews ExactCommittedRecord or the test that failed: HTTP standing, transport failure, invalid JSON, an undecodable string, invalid form, or document mismatch. WriteError and ReadError preserve the exception diagnostics. An unhandled native or script-terminating error exits 1. A accomplished Unknown API consequence exits 2.
Cancellation can cease the consumer earlier than it emits an entire consequence with out undoing the server commit. Microsoft paperwork Ctrl+C exit 0 for pwsh -File, so a lacking or incomplete consequence leaves the write unsure even with exit 0. This consumer has no cancellation-triggered GET in lastly. Recent cancellation wasn’t measured right here; conduct throughout hosts and termination mechanisms stays unverified.
Why a response can fail the document test
Confirming the improper operation or schedule
Get-RecordReason checks the operation and its saved values. A distinct operation ID belongs to a different write. A schedule for 03:30 would not match the meant 02:30. The document should say dedicated and match the unique job and enabled worth.
Take a look at-StringFields requires JSON strings for operationId, state, job, and timeUtc. Get-JsonString decodes them for comparability with the unique ID, dedicated, and the saved job and time. enabled should be a JSON Boolean equal to the meant true. The JSON string "true" fails.
Decoded property names and string values should match precisely, together with case. The checks use culture-independent ordinal equality. Equal string escaping, property order, and whitespace can range. Peculiar PowerShell comparisons might coerce values or ignore case; these checks enable neither.
Accepting lacking or ambiguous fields
The consumer inspects fields with JsonDocument earlier than evaluating values. Take a look at-Fields requires precisely operationId, state, and payload within the root object, and precisely job, timeUtc, and enabled within the payload object.
Every area should happen as soon as in its object. Lacking, further, or duplicate fields fail. A one-element array rather than both object additionally fails. The consumer will not verify an incomplete document or select between duplicate values.
Accepting a string that can’t be decoded
.NET can parse JSON earlier than decoding each property title or string worth. Get-JsonString checks the native kind earlier than decoding. An unescape error throughout that later step can nonetheless stop the response from confirming the write.
Get-ResponseReason reviews this decoding failure as UndecodableString. If the 201 response fails this test, the consumer makes its one GET for the unique ID. A 200 with the precise dedicated document can nonetheless verify the write. An undecodable 200 readback leaves Unknown. Flawed native varieties, disposed objects, and sudden errors nonetheless throw; they do not turn out to be unsure API outcomes.
Repeat the POST intentionally
Cease the earlier server, then begin Regular in terminal A:
pwsh -NoProfile -File ./server.ps1 -RunDirectory './run-normal' -State of affairs Regular
Create one schedule in terminal B:
pwsh -NoProfile -File ./consumer.ps1 -IntentPath './intent-normal.json'
$LASTEXITCODE
Explicitly repeat the saved request as soon as:
$ErrorActionPreference="Cease"
$intent = Get-Content material -LiteralPath './intent-normal.json' -Uncooked | ConvertFrom-Json
$physique = Get-Content material -LiteralPath './intent-normal.json' -Uncooked
$choices = @{
MaximumRetryCount = 0; MaximumRedirection = 0
ConnectionTimeoutSeconds = 3; OperationTimeoutSeconds = 3
HttpVersion = '1.1'; DisableKeepAlive = $true; NoProxy = $true
SkipHttpErrorCheck = $true; ErrorAction = 'Cease'
}
$repeat = Invoke-WebRequest @choices -Uri 'http://127.0.0.1:8765/schedules' -Technique Put up `
-Physique ([Text.Encoding]::UTF8.GetBytes($physique)) -ContentType 'software/json; charset=utf-8'
$lookup = Invoke-WebRequest @choices -Uri "http://127.0.0.1:8765/operations/$($intent.operationId)"
[pscustomobject]@{ RepeatStatus = [int]$repeat.StatusCode; LookupStatus = [int]$lookup.StatusCode }
@(Get-Content material -LiteralPath './run-normal/schedules.jsonl').Rely
The recorded repeat produced:
RepeatStatus LookupStatus
------------ ------------
201 409
2
The second POST returned 201 and added a second precise row. With two information for a similar ID, the GET returned 409 as an alternative of selecting one. The operation ID connects the requests to their information, however this server would not stop duplicates.
Earlier than retrying a manufacturing POST, test the server’s documented key scope and the way it binds the important thing to the payload. Duplicate dealing with should be atomic with the enterprise impact. Examine conflicting payloads, concurrent requests, key retention, and the lookup’s learn consistency. The server can ignore Idempotency-Key, so including the header alone would not make a retry secure.
This listener is a instructing fixture with no authentication, concurrent business-write dealing with, or database transactions. The learn index and held responses keep in reminiscence. The JSON-lines recordsdata survive an odd cease, however the server would not reload them on restart. It would not assure crash consistency or power-loss sturdiness.
If readback leaves the write unknown, preserve the intent and consequence and cease automation that relies on the write. Examine the unique operation by way of the API’s documented learn path earlier than deciding whether or not to ship one other POST.

