fix(realunit): log Aktionariat confirm-link rejections at warn instead of error#4199
Draft
Danswar wants to merge 1 commit into
Draft
fix(realunit): log Aktionariat confirm-link rejections at warn instead of error#4199Danswar wants to merge 1 commit into
Danswar wants to merge 1 commit into
Conversation
…d of error A 4xx from the confirm call is a rejected link (expired code, unknown email; 400/417 observed in prod) — the same handled outcome that mapConfirmationStatus buckets as INVALID, not a system fault. The call carries no API key (the code is the credential), so a 4xx cannot mean broken credentials. 429 stays at error: throttling is systemic. 5xx/timeout/no-status keep logging at error as before.
53aff87 to
659b5ca
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Part of the error-rate-reduction effort: a user clicking an expired/already-used Aktionariat confirm link produces an ERROR-level log line, although the code already treats the outcome as handled (
mapConfirmationStatusbuckets 4xx asINVALID). Observed in prod Loki: statuses 400/417, ~2 lines/week — routine user behavior, not a fault.What
In
callAktionariatConfirm, log the failure atwarnwhen the status maps toINVALID, with 429 carved back out toerror(throttling is a systemic fault, not a per-link rejection). 5xx / timeout / no-status keep logging aterroras before. A 4xx here cannot mean broken integration credentials: the call carries no API key — the confirmation code itself is the credential.Tests: the 4xx rejection test asserts warn (and no error), a new test pins 429 at error, and the PII-redaction test now checks the warn channel.
Scope notes
Earlier revisions of this PR also touched two other call sites; both were dropped after investigation:
QueryFailedErrorwas already root-caused and fixed by fix(kyc): assign merged kyc steps absolute sequence numbers #4027 (deployed 07-03, clean since). The remaining "Verified name mismatch" noise (11 lines/30d, single entity) is better addressed at the root (the AML cron re-attempts a merge that deterministically fails) than by log-level games — tracked separately.{"type":"test"}webhook ping: 30 days of logs show the only such traffic was self-generated probing during the audit itself; the error line is the tripwire for unsigned webhook calls and stays as is.Test plan
pre-pushhook)