This assumption will fail if modified clients don’t send the block inv after the last block being sent.
It is possible that a modified client may want to send only a limited number of blocks and not have the requesting node send more requests. In this case, the modified node will not send the inv of the next block to prompt the requesting node to send a further getblocks.
A solution to this is to make nodes able to detect when the sending node has stopped sending blocks (e.g. a block isn’t being sent immediately after the last block was received). In this case, it can determine that the SyncNode is no longer a SyncNode and re-select a SyncNode to which to send the next getblocks.