fix incorrect refactoring and add comments (#4236)
### Description
Previous PR introduced a bug, which caused the update to be incorrectly
taken:
https://github.com/vercel/turbo/pull/4208/files#diff-a50d2da0351cec2aa42fefbb4374be064cc62bcf56c0d56f3b7edf96a92bac33L585-L588