Skip to content

OP-002: Clear invalid person keyword syncs

Before the unprocessed batch is retrieved, the application clears any keyword syncs whose person_id no longer exists and logs one line per cleared record. The method name is misspelled in source (ProcessInavlidPersonKeywordSyncs) and is preserved verbatim here.

Field Value
Operation ID OP-002
Trigger Step 4 of OP-001
Lifecycle stage Execute
Owning component OnBaseKeywordSyncRunner.ProcessInvalidKeywordSyncs → ImagingApiClient.ProcessInavlidPersonKeywordSyncs
Inputs None (remote API call with a null body)
Outputs Server-side clear of invalid records; one log line per cleared record
Failure exit code 5 — propagates from OnBaseKeywordSyncRunner.Execute's catch block

Steps

  1. PUT ImageKeywordSyncs/ClearInvalidPersonUpdates with a null body; take .Results (BR-OBKS-002)
  2. On failure: propagates → exit code 5
  3. For each returned InvalidKeywordSync, log "Keyword sync id {KeywordSyncId} was not processed because the person_id {PersonId} did not exist. Marked as processed." (BR-OBKS-002)
  4. Whether the Imaging API's ClearInvalidPersonUpdates also marks records processed server-side is asserted by the log text but no client-side mark call follows*

Process flow

The following diagram visualizes this operation's control flow.

flowchart TD
    A["PUT ImageKeywordSyncs/<br>ClearInvalidPersonUpdates"] --> B{"Any records<br>returned?"}
    B -->|Yes| C["Log one line per<br>InvalidKeywordSync record"]
    B -->|No| D["Continue - nothing to log"]
    C --> E["Return to OP-001"]
    D --> E
    A -.->|Exception| ERR["Exit code 5"]

Logging

Log id Written content
Not application-assigned (fans out to all registered file0–file4 writers) "Keyword sync id {id} was not processed because the person_id {personId} did not exist. Marked as processed." per cleared record

Error handling

  • Any exception from the PUT call propagates to OnBaseKeywordSyncRunner.Execute's catch block, which logs and rethrows → exit code 5.

Note: Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts.

Sources

  • OnBaseKeywordSync/OnBaseKeywordSyncRunner.cs
  • OnBaseKeywordSync/Services/ImagingApiClient.cs
  • OnBaseKeywordSync/Contracts/InvalidKeywordSync.cs