(
ref: ConnectionRef,
result: HealthCheckResult,
)
| 5141 | * landing even between the read and the UPDATE wins and the probe |
| 5142 | * verdict is a silent no-op. Best-effort, like every verdict write. */ |
| 5143 | const persistProbeHealthResult = ( |
| 5144 | ref: ConnectionRef, |
| 5145 | result: HealthCheckResult, |
| 5146 | ): Effect.Effect<void> => |
| 5147 | findConnectionRow(ref).pipe( |
| 5148 | Effect.flatMap((fresh) => |
| 5149 | fresh === null || |
| 5150 | oauthReauthRequiredFromProviderState(fresh.provider_state) !== null || |
| 5151 | // A credential verdict cannot refute a failed tool sync; only a |
| 5152 | // successful sync clears that record (see `isToolSyncHealth`). |
| 5153 | isToolSyncHealth(Option.getOrNull(decodeLastHealth(fresh.last_health))) |
| 5154 | ? Effect.void |
| 5155 | : persistHealthResult(ref, fresh, result), |
| 5156 | ), |
| 5157 | Effect.ignore, |
| 5158 | ); |
| 5159 | |
| 5160 | const connectionCheckHealth = ( |
| 5161 | ref: ConnectionRef, |
no test coverage detected