Conversation
✅ Deploy Preview for rstest-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a bug in the default worker count calculation where the wrong property was being accessed when reducing over entry counts. The code was attempting to get the length of entries directly instead of accessing the entries property of each entry object.
- Corrects property access in the worker count calculation logic
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
| ? Number.POSITIVE_INFINITY | ||
| : Array.from(entriesCache.values()).reduce( | ||
| (acc, entries) => acc + Object.keys(entries).length, | ||
| (acc, entry) => acc + Object.keys(entry.entries).length, |
There was a problem hiding this comment.
This fix assumes that each entry has an 'entries' property, but the original code suggested that the values from entriesCache were directly the entries objects. Please verify that the structure of entriesCache values actually contains an 'entries' property, as this change could introduce a runtime error if the property doesn't exist.
| (acc, entry) => acc + Object.keys(entry.entries).length, | |
| (acc, entry) => acc + (entry && entry.entries && typeof entry.entries === 'object' ? Object.keys(entry.entries).length : 0), |
Summary
fix default worker counts when calc by entry counts.
Related Links
Checklist