Conversation
Remove comments that restate the code or narrate its history, keep each explanation in one place, correct comments that no longer match the code, and fold repeated blocks within a file into small local helpers. No behavioural change intended.
# Conflicts: # packages/provider/src/tasks/detection/getBotScore.ts
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.
What changed
Only files in
packages/provider/src(not tests). 67 files, about 1,900 lines removed and 900 added.Comments
// Check if email is spam).checkForHardBlockdoc (said it only checks Block policies),backgroundBuffer.take()(said it returns null), thehardBlockVerdictCacherace note (said a race was impossible), and a doc comment attached to the wrong function inforwardVerify.ts.Code (small, same-file only)
persistRejectionin puzzle verify (6 copies)serveImageCaptchain the frictionless decision machine (5 copies)writeSubmissionResult/rejectSubmissionin image solution submitinvalidateCachedSessionAndHashincaptchaManagercacheSessionRecordinfrictionlessTasksfetchAndCacheArtifact/pickByPriorityindecisionMachineRunnerisValidPrivateKey), redundant casts and pointless temporary variables.temp→siteSettings,lConfig→languagePenalties).What effect it has
None intended. Exports, HTTP responses, status codes, error keys and log messages are unchanged. Nothing moved between files.
How it was checked
mainbefore the change. No tests were added or changed.tsc --noEmiton provider reports 0 errors, same as before. (build:tscfails onmainfor an unrelated reason: a staleredisinstall breaksredis-client.)Noticed while tidying, deliberately not changed
These look like real bugs or smells. Worth separate PRs:
puzzleTasks.ts).evaluateEmailSpamRules, so per-site email rules don't apply to puzzle captchas.datasetTasksUtils.tschecks the solved count againstminUnsolvedCaptchas.hardBlockVerdictCacheleaves outwebBotAuthAgent, so a verified bot and an unverified request with the same IP/JA4/UA share a cached rule list for up to 10s.validation.valid.token(possibly"") instead ofsessionToken.decryptPayloadnever returnsdz, although it is decoded and stored elsewhere.accessPolicy.tsdoesn't record theauto_ban_scoremetric thatdecisionMachine.tsdoes.validateSessionIPalways returns valid, so thecurrentIPbranch inisValidRequestcan never fail.if (!solution)in image verify, becausegetDappUserCommitmentByIdthrows first.!backgroundthrow inpuzzleRenderer.providedIpwhen there was no earlier failure; image and puzzle always store it.