crawlee icon indicating copy to clipboard operation
crawlee copied to clipboard

`RestrictedCrawlingContext` should not extend `Record<string, unknown>`

Open janbuchar opened this issue 1 year ago • 2 comments

The parent is there for backwards compatibility and it leads to subtle bugs that could be prevented with type checking otherwise.

janbuchar avatar Feb 08 '24 16:02 janbuchar

Hey can you give some info on how to replicate the bug in my locals ?

AbhinawRatan avatar Mar 13 '24 20:03 AbhinawRatan

The line in question is this: https://github.com/apify/crawlee/blob/2dce7fb8671639a333e3ade3863a1ef07d6a34b0/packages/core/src/crawlers/crawler_commons.ts#L17

And the problem is that the type as it is now allows accessing any property, which leads to errors that Typescript cannot prevent.

However, I don't think this is a good first issue if you're looking to contribute to Crawlee. It's in the milestone for a 4.0 release which doesn't have a fixed schedule yet, so if you manage to fix it, the PR is going to stick around for a while.

janbuchar avatar Mar 14 '24 08:03 janbuchar