Repository navigation
Fix scope-deleting polls, migration lockout, and cancellation gaps - #51
Merged
Merged
Conversation
On a desktop, credentials tests reached the real keyring and hung on the unlock prompt (10 min timeout) or read stored credentials. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- --category/--bbp-only/--private-only with --db merged a filtered subset as full scope, deleting filtered-out targets; now merge-only, no sync. - Plain --db polls deleted every stored AI variant; stored variants are now reattached on every poll. - One platform's auth failure aborted 'bbscope poll'; the platforms that authenticated are polled and the exit code stays non-zero. - A program URL owned by a custom entry failed the platform and blocked its sync on every run; it is now a per-program warning. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- whttp requests take a context, passed by every poller including Bugcrowd's rate limiter and Bugcrowd/YesWeHack login (TOTP wait too). - Immunefi fails fast on 4xx, backs off on 5xx, sleeps cancelably, and caps outer retries at 3 (whttp already retries each call 10 times). - YesWeHack reads nb_pages from page 1 only, so a later page without pagination can no longer end the listing early. - Remove unused bugcrowd.NewPollerWithLogin. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Optional migration rewrites ignored unique violations inside the transaction, which Postgres then aborted, so Open failed forever on legacy duplicates. They now run in a savepoint. - NormalizeTarget was not idempotent (example.com./, //host:443, port-only authorities). The fuzzer now asserts idempotency. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AI rows exported the variant's effective in_scope only, and import used it for the base target, flipping in-scope targets with an out-of-scope variant. Export base_in_scope (JSON and CSV) and use it on import. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
Bug hunt fixes, each with a regression test (most verified to fail on the old code against Postgres 16).
Data loss
poll --dbwith--category/--bbp-only/--private-onlystored a filtered subset as full scope and deleted the rest → now merge-only, program sync skipped.poll --dbwithout--aideleted all stored AI variants → stored variants are reattached on every poll.in_scopewhen it had an AI variant override → newbase_in_scopefield (JSON + CSV); old backups import as before.Availability
storage.Openfailed on every start for legacy duplicates → savepoint.bbscope poll→ remaining platforms are polled, exit code stays non-zero.Cancellation / retries
Other
NormalizeTargetis now idempotent (example.com./,//host:443, port-only authorities); fuzz test asserts it.bugcrowd.NewPollerWithLogin; Bugcrowd fetch functions takectx.Test plan
go build ./... && go vet ./...,golangci-lint run(0 issues)go test -race ./...withTEST_DB_URLagainst Postgres 16FuzzNormalizeTarget3 min cleanbbscope poll dev --dbend to end (repeat poll: no changes;--categorykeeps scope)🤖 Generated with Claude Code