@ovok/core 0.4.59-dev.557 → 0.4.59-dev.558
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -26,7 +26,7 @@ exports.OVOK_CORE_REQUIREMENTS = {
|
|
|
26
26
|
description: "The FHIR surface a server must provide for the @ovok/core client library's own methods to function.",
|
|
27
27
|
software: {
|
|
28
28
|
name: "@ovok/core",
|
|
29
|
-
version: "0.4.59-dev.
|
|
29
|
+
version: "0.4.59-dev.558+54a54fc",
|
|
30
30
|
},
|
|
31
31
|
fhirVersion: "4.0.1",
|
|
32
32
|
format: ["json"],
|
|
@@ -11,6 +11,10 @@ const MAX_RECONNECT_DELAY_MS = 30000;
|
|
|
11
11
|
/** What the server answers for the binding of a Subscription it no longer has. */
|
|
12
12
|
const FORGOTTEN_SUBSCRIPTION_STATUSES = new Set([400, 404, 410]);
|
|
13
13
|
const isForgottenSubscription = (error) => error instanceof ovok_errors_1.OvokError && error.status !== null && FORGOTTEN_SUBSCRIPTION_STATUSES.has(error.status);
|
|
14
|
+
/** One the server already forgot counts as deleted, so a gone Subscription never keeps the others alive. */
|
|
15
|
+
const deleteSubscription = (fhir, id) => fhir.delete("Subscription", id).catch((error) => { if (!isForgottenSubscription(error)) {
|
|
16
|
+
throw error;
|
|
17
|
+
} });
|
|
14
18
|
class RealtimeConnection {
|
|
15
19
|
constructor(http, fhir, baseUrl, session, criteria, handler) {
|
|
16
20
|
this.http = http;
|
|
@@ -56,7 +60,7 @@ class RealtimeConnection {
|
|
|
56
60
|
this.socket = null;
|
|
57
61
|
for (const entry of this.entries) {
|
|
58
62
|
if (entry.subscriptionId !== null) {
|
|
59
|
-
await this.fhir
|
|
63
|
+
await deleteSubscription(this.fhir, entry.subscriptionId);
|
|
60
64
|
}
|
|
61
65
|
}
|
|
62
66
|
this.deleted = true;
|