Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
/**
* Retry only when nothing can have reached the target. A half-applied change replayed on a second
* member would apply twice.
*/
/** `transportError` is never cleared, so requiring that no channel established is what bounds it. */
export const isGatewayTransportFailure = ({
transportError,
establishedChannel
}: {
transportError: string;
establishedChannel: boolean;
}): boolean => Boolean(transportError) && !establishedChannel;
/** An early tunnel can fail while a later one reaches the target, so a transport failure alone is not enough. */
export const isAttemptRetryable = ({
transportFailed,
tunnelEstablished,
isTransportError
}: {
transportFailed: boolean;
tunnelEstablished: boolean;
isTransportError: boolean;
}): boolean => (transportFailed || isTransportError) && !tunnelEstablished;