Skip to content

Commit a765e0d

Browse files
committed
1 parent fa997b9 commit a765e0d

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ This file is a running track of new features and fixes to each version of the pa
33

44
This project follows [Semantic Versioning](http://semver.org) guidelines.
55

6+
## v0.7.4 (Derelict Dermodactylus)
7+
### Fixed
8+
* Fixes a bug when reinstalling a server that would not mark the server as installing, resulting in some UI issues.
9+
610
## v0.7.3 (Derelict Dermodactylus)
711
### Fixed
812
* Fixes server creation API endpoint not passing the provided `external_id` to the creation service.

app/Services/Servers/ReinstallServerService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function reinstall($server)
6666
$this->database->beginTransaction();
6767
$this->repository->withoutFreshModel()->update($server->id, [
6868
'installed' => 0,
69-
]);
69+
], true, true);
7070

7171
try {
7272
$this->daemonServerRepository->setServer($server)->reinstall();

tests/Unit/Services/Servers/ReinstallServerServiceTest.php

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,9 @@ public function testServerShouldBeReinstalledWhenModelIsPassed()
8181
$this->repository->shouldNotReceive('find');
8282

8383
$this->database->shouldReceive('beginTransaction')->withNoArgs()->once()->andReturnNull();
84-
$this->repository->shouldReceive('withoutFreshModel')->withNoArgs()->once()->andReturnSelf()
85-
->shouldReceive('update')->with($this->server->id, [
86-
'installed' => 0,
87-
])->once()->andReturnNull();
84+
$this->repository->shouldReceive('withoutFreshModel->update')->with($this->server->id, [
85+
'installed' => 0,
86+
], true, true)->once()->andReturnNull();
8887

8988
$this->daemonServerRepository->shouldReceive('setServer')->with($this->server)->once()->andReturnSelf()
9089
->shouldReceive('reinstall')->withNoArgs()->once()->andReturn(new Response);
@@ -101,10 +100,9 @@ public function testServerShouldBeReinstalledWhenServerIdIsPassed()
101100
$this->repository->shouldReceive('find')->with($this->server->id)->once()->andReturn($this->server);
102101

103102
$this->database->shouldReceive('beginTransaction')->withNoArgs()->once()->andReturnNull();
104-
$this->repository->shouldReceive('withoutFreshModel')->withNoArgs()->once()->andReturnSelf()
105-
->shouldReceive('update')->with($this->server->id, [
106-
'installed' => 0,
107-
])->once()->andReturnNull();
103+
$this->repository->shouldReceive('withoutFreshModel->update')->with($this->server->id, [
104+
'installed' => 0,
105+
], true, true)->once()->andReturnNull();
108106

109107
$this->daemonServerRepository->shouldReceive('setServer')->with($this->server)->once()->andReturnSelf()
110108
->shouldReceive('reinstall')->withNoArgs()->once()->andReturn(new Response);
@@ -121,10 +119,9 @@ public function testServerShouldBeReinstalledWhenServerIdIsPassed()
121119
public function testExceptionThrownByGuzzleShouldBeReRenderedAsDisplayable()
122120
{
123121
$this->database->shouldReceive('beginTransaction')->withNoArgs()->once()->andReturnNull();
124-
$this->repository->shouldReceive('withoutFreshModel')->withNoArgs()->once()->andReturnSelf()
125-
->shouldReceive('update')->with($this->server->id, [
126-
'installed' => 0,
127-
])->once()->andReturnNull();
122+
$this->repository->shouldReceive('withoutFreshModel->update')->with($this->server->id, [
123+
'installed' => 0,
124+
], true, true)->once()->andReturnNull();
128125

129126
$this->daemonServerRepository->shouldReceive('setServer')->with($this->server)->once()->andThrow($this->exception);
130127

@@ -139,10 +136,9 @@ public function testExceptionThrownByGuzzleShouldBeReRenderedAsDisplayable()
139136
public function testExceptionNotThrownByGuzzleShouldNotBeTransformedToDisplayable()
140137
{
141138
$this->database->shouldReceive('beginTransaction')->withNoArgs()->once()->andReturnNull();
142-
$this->repository->shouldReceive('withoutFreshModel')->withNoArgs()->once()->andReturnSelf()
143-
->shouldReceive('update')->with($this->server->id, [
144-
'installed' => 0,
145-
])->once()->andReturnNull();
139+
$this->repository->shouldReceive('withoutFreshModel->update')->with($this->server->id, [
140+
'installed' => 0,
141+
], true, true)->once()->andReturnNull();
146142

147143
$this->daemonServerRepository->shouldReceive('setServer')->with($this->server)->once()->andThrow(new Exception());
148144

0 commit comments

Comments
 (0)