Both patches are correct, async operations take a ref on the object itself, so unref after starting an async operation is valid and arguably more readable as you don't need to follow all the callbacks to discover when are all the async operations finished (plus no need to worry about errors).
Both patches are correct, async operations take a ref on the object itself, so unref after starting an async operation is valid and arguably more readable as you don't need to follow all the callbacks to discover when are all the async operations finished (plus no need to worry about errors).