Duration on job was not specified, beacuse we actually don't return
duration from the API, it's always calculated based on startedAt and
finishedAt, that's why it's obsolete. It doesn't hurt to have it defined
on the Job model, but there's no need to do it.
* duration was not actually defined in Travis.Job, which may have caused
bugs when combined with partial record loading (so for example it was
ok on a refresh, but may have been broken on update)
* notStarted was not a dependency of duration
For some reason mocked ajax queries don't fire when build page is opened
directly in specs. I don't want to go into detail at this point, because
I plan rewriting build/job related views and controllers to decouple
repo controller anyway, which should fix some of the oddities.
We set job and build directly on repo controller for routes like job,
build and repo.index. We also need to clean that up when we exit to not
show for example download log button when we switch to different route.
A while ago I introduced a change to auth code which signs out user on
failed try to get user data. The problem with it was it signed out on
all kind of errors, like network error. I changed the code to log out on
401 status, but I haven't tested it properly, we actually return 403 on
unauthenticated queries for user data.
We no longer need this check, because it was only relevant with Ember
Data. Additionally it was a cause of a travis-ci/travis-ci#1992, because
of wrong syntax:
unless someFunction false or true
will only check for a result of someFunction with an argument being the
result of `or` expression.
User data needs to be refreshed on sign in, otherwise we don't have
fresh data regarding isSyncing property and other fields which can
change between refreshing page.