Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RestrictedCrawlingContext should not extend Record<string, unknown> #2325

Open
janbuchar opened this issue Feb 8, 2024 · 2 comments
Open
Labels
bug Something isn't working. t-tooling Issues with this label are in the ownership of the tooling team.
Milestone

Comments

@janbuchar
Copy link
Contributor

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

@janbuchar janbuchar added the bug Something isn't working. label Feb 8, 2024
@janbuchar janbuchar added this to the 4.0 milestone Feb 8, 2024
@B4nan B4nan added the t-tooling Issues with this label are in the ownership of the tooling team. label Feb 12, 2024
@AbhinawRatan
Copy link

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

@janbuchar
Copy link
Contributor Author

The line in question is this:

export interface RestrictedCrawlingContext<UserData extends Dictionary = Dictionary> extends Record<string & {}, unknown> {

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working. t-tooling Issues with this label are in the ownership of the tooling team.
Projects
None yet
Development

No branches or pull requests

3 participants