The algorithm was done so that it almost never froze, by giving enough time for most of API calls to finish (based on him knowing the response times it usually got).
And even when it did, clients are conditioned to expect progress bars to freeze and then suddenly finish, from Windows and lots of other software.
Sorry. I thought it was clear from context that I replied to the conditioning remark.
The indeterminate progress bar/spinner were invented decades ago for this use case. There’s no need to assume users are “conditioned to expect progress bars to freeze and then suddenly finish”, and reinforce that.
If you don’t know when bytes will start arriving or how many will arrive, don’t pretend you do know.
And even when it did, clients are conditioned to expect progress bars to freeze and then suddenly finish, from Windows and lots of other software.