Log is shown incorrectly and not saved after job restart

A similar problem was previously reported (and fixed) at https://github.com/travis-ci/travis-ci/issues/2195 and https://github.com/travis-ci/travis-ci/issues/1856 .

When I restart a job, in its log, I either see the previous log or nothing at all, followed by a live feed of the current log:

In the 2nd case at least, after the job finishes, if I refresh the page, there’s no log at all: