-
Notifications
You must be signed in to change notification settings - Fork 24
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
refactor: replace trivial lodash functions with native equivalents #323
Conversation
How can we be sure this does not introduce bugs? |
How confident are you? :) |
As confident as I will get. Read through it thrice and did all the manual testing I could think of. Maybe we should maintain a manual test list for situations like this? |
I think you just have to ensure that it is well-tested. Perhaps by keeping a list of the places you have changed and then being sure that you test in a way that is likely to exercise those code paths. |
server/src/engine/queue.ts
Outdated
waitingForPriorityQueue = {} | ||
return values | ||
} | ||
|
||
let enqueueDebounced: () => void = makeEnqueueDebounced() | ||
|
||
function handleEnqueue() { | ||
if (_.isEmpty(waitingForPriorityQueue)) { | ||
if (Object.keys(waitingForPriorityQueue).length === 0) { | ||
return | ||
} | ||
priorityQueue.push(...emptyWaitingForPriorityQueue()) | ||
startQueue() | ||
} | ||
|
||
function makeEnqueueDebounced() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps this debouce can be in a separate PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then we'd have to keep in the dependency and make a third PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think breaking this PR down to a few smaller PRs reduces the risk.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, exactly.
I don't remember exactly what I have tested when, so I can go through it one more time if you would prefer |
@magnus-madsen |
Until we have tests, I think I would only be comfortable if we did this slowly, one file at a time. That way we would minimize breakages and maximize the chance that we can catch all errors. |
Lets try for some tests. Then we can go file-by-file. I will close this meanwhile. (You can still find it). |
Builds on #322