Skip to content

fix(core): accept the documented requestManager crawler option - #4030

Open
NotAFlightRisk wants to merge 1 commit into
apify:masterfrom
NotAFlightRisk:fix/accept-request-manager-option
Open

fix(core): accept the documented requestManager crawler option#4030
NotAFlightRisk wants to merge 1 commit into
apify:masterfrom
NotAFlightRisk:fix/accept-request-manager-option

Conversation

@NotAFlightRisk

Copy link
Copy Markdown

Went to share a queue between two crawlers, found requestManager in the BasicCrawlerOptions docs, and passing it throws before anything runs:

ArgumentError: Did not expect property `requestManager` to exist, got `[object Object]` in object `BasicCrawlerOptions`

The key just isn't in optionsShape, and ow.object.exactShape is the first thing the constructor does - so the handling below it, including the "cannot be used in conjunction with requestList and/or requestQueue" error, is unreachable. No way round it short of subclassing.

Borrowed the validator key list from the one on v4 so the two branches agree. Every subclass spreads optionsShape, so this covers Cheerio/ Playwright/ Puppeteer/ JSDOM/ HTTP too.

Happy to drop the validators entry and use a plain ow.optional.object if you'd rather keep the diff to one line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants