Fix instance deleted status not being sent out

This commit is contained in:
Hornwitser committed 2021-06-10 10:26:40 +02:00
1 parent 7a49e8aa15
commit f37c387d52
3 files changed
+6 -5

No files matched your search

+1 -1
View File
@@ -374,7 +374,7 @@ let instanceProperties = {
"assigned_slave": { type: ["null", "integer"] },
"status": { enum: [
"unknown", "unassigned", "stopped", "starting", "running", "stopping",
"creating_save", "exporting_data",
"creating_save", "exporting_data", "deleted",
]},
};
+1 -1
View File
@@ -252,7 +252,7 @@ class ControlConnection extends BaseConnection {
let prev = instance.status;
instance.status = "deleted";
this.instanceUpdated(instance);
this._master.instanceUpdated(instance);
await libPlugin.invokeHook(this._master.plugins, "onInstanceStatusChanged", instance, prev);
}
+4 -3
View File
@@ -501,9 +501,10 @@ describe("Integration of Clusterio", function() {
describe("instanceUpdateEventHandler()", function() {
it("should have triggered for the previous instance status updates", function() {
let statusesToCheck = new Set(
["unassigned", "stopped", "creating_save", "exporting_data", "starting", "running", "stopping"]
);
let statusesToCheck = new Set([
"unassigned", "stopped", "creating_save", "exporting_data",
"starting", "running", "stopping", "deleted",
]);
let statusesNotSeen = new Set(statusesToCheck);
for (let update of getControl().instanceUpdates) {