summaryrefslogtreecommitdiff
path: root/includes/external/matrix/node_modules/matrix-js-sdk/lib/rust-crypto/KeyClaimManager.js.map
diff options
context:
space:
mode:
authorRaindropsSys <raindrops@equestria.dev>2023-11-17 23:25:29 +0100
committerRaindropsSys <raindrops@equestria.dev>2023-11-17 23:25:29 +0100
commit953ddd82e48dd206cef5ac94456549aed13b3ad5 (patch)
tree8f003106ee2e7f422e5a22d2ee04d0db302e66c0 /includes/external/matrix/node_modules/matrix-js-sdk/lib/rust-crypto/KeyClaimManager.js.map
parent62a9199846b0c07c03218703b33e8385764f42d9 (diff)
downloadpluralconnect-953ddd82e48dd206cef5ac94456549aed13b3ad5.tar.gz
pluralconnect-953ddd82e48dd206cef5ac94456549aed13b3ad5.tar.bz2
pluralconnect-953ddd82e48dd206cef5ac94456549aed13b3ad5.zip
Updated 30 files and deleted 2976 files (automated)
Diffstat (limited to 'includes/external/matrix/node_modules/matrix-js-sdk/lib/rust-crypto/KeyClaimManager.js.map')
-rw-r--r--includes/external/matrix/node_modules/matrix-js-sdk/lib/rust-crypto/KeyClaimManager.js.map1
1 files changed, 0 insertions, 1 deletions
diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rust-crypto/KeyClaimManager.js.map b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rust-crypto/KeyClaimManager.js.map
deleted file mode 100644
index d3d4786..0000000
--- a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rust-crypto/KeyClaimManager.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"KeyClaimManager.js","names":["KeyClaimManager","constructor","olmMachine","outgoingRequestProcessor","_defineProperty2","default","currentClaimPromise","Promise","resolve","stop","stopped","ensureSessionsForUsers","userList","prom","catch","then","ensureSessionsForUsersInner","Error","claimRequest","getMissingSessions","makeOutgoingRequest","exports"],"sources":["../../src/rust-crypto/KeyClaimManager.ts"],"sourcesContent":["/*\nCopyright 2023 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { OlmMachine, UserId } from \"@matrix-org/matrix-sdk-crypto-js\";\n\nimport { OutgoingRequestProcessor } from \"./OutgoingRequestProcessor\";\n\n/**\n * KeyClaimManager: linearises calls to OlmMachine.getMissingSessions to avoid races\n *\n * We have one of these per `RustCrypto` (and hence per `MatrixClient`).\n */\nexport class KeyClaimManager {\n private currentClaimPromise: Promise<void>;\n private stopped = false;\n\n public constructor(\n private readonly olmMachine: OlmMachine,\n private readonly outgoingRequestProcessor: OutgoingRequestProcessor,\n ) {\n this.currentClaimPromise = Promise.resolve();\n }\n\n /**\n * Tell the KeyClaimManager to immediately stop processing requests.\n *\n * Any further calls, and any still in the queue, will fail with an error.\n */\n public stop(): void {\n this.stopped = true;\n }\n\n /**\n * Given a list of users, attempt to ensure that we have Olm Sessions active with each of their devices\n *\n * If we don't have an active olm session, we will claim a one-time key and start one.\n *\n * @param userList - list of userIDs to claim\n */\n public ensureSessionsForUsers(userList: Array<UserId>): Promise<void> {\n // The Rust-SDK requires that we only have one getMissingSessions process in flight at once. This little dance\n // ensures that, by only having one call to ensureSessionsForUsersInner active at once (and making them\n // queue up in order).\n const prom = this.currentClaimPromise\n .catch(() => {\n // any errors in the previous claim will have been reported already, so there is nothing to do here.\n // we just throw away the error and start anew.\n })\n .then(() => this.ensureSessionsForUsersInner(userList));\n this.currentClaimPromise = prom;\n return prom;\n }\n\n private async ensureSessionsForUsersInner(userList: Array<UserId>): Promise<void> {\n // bail out quickly if we've been stopped.\n if (this.stopped) {\n throw new Error(`Cannot ensure Olm sessions: shutting down`);\n }\n const claimRequest = await this.olmMachine.getMissingSessions(userList);\n if (claimRequest) {\n await this.outgoingRequestProcessor.makeOutgoingRequest(claimRequest);\n }\n }\n}\n"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACO,MAAMA,eAAe,CAAC;EAIlBC,WAAWA,CACGC,UAAsB,EACtBC,wBAAkD,EACrE;IAAA,KAFmBD,UAAsB,GAAtBA,UAAsB;IAAA,KACtBC,wBAAkD,GAAlDA,wBAAkD;IAAA,IAAAC,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA,mBAJrD,KAAK;IAMnB,IAAI,CAACC,mBAAmB,GAAGC,OAAO,CAACC,OAAO,EAAE;EAChD;;EAEA;AACJ;AACA;AACA;AACA;EACWC,IAAIA,CAAA,EAAS;IAChB,IAAI,CAACC,OAAO,GAAG,IAAI;EACvB;;EAEA;AACJ;AACA;AACA;AACA;AACA;AACA;EACWC,sBAAsBA,CAACC,QAAuB,EAAiB;IAClE;IACA;IACA;IACA,MAAMC,IAAI,GAAG,IAAI,CAACP,mBAAmB,CAChCQ,KAAK,CAAC,MAAM;MACT;MACA;IAAA,CACH,CAAC,CACDC,IAAI,CAAC,MAAM,IAAI,CAACC,2BAA2B,CAACJ,QAAQ,CAAC,CAAC;IAC3D,IAAI,CAACN,mBAAmB,GAAGO,IAAI;IAC/B,OAAOA,IAAI;EACf;EAEA,MAAcG,2BAA2BA,CAACJ,QAAuB,EAAiB;IAC9E;IACA,IAAI,IAAI,CAACF,OAAO,EAAE;MACd,MAAM,IAAIO,KAAK,CAAE,2CAA0C,CAAC;IAChE;IACA,MAAMC,YAAY,GAAG,MAAM,IAAI,CAAChB,UAAU,CAACiB,kBAAkB,CAACP,QAAQ,CAAC;IACvE,IAAIM,YAAY,EAAE;MACd,MAAM,IAAI,CAACf,wBAAwB,CAACiB,mBAAmB,CAACF,YAAY,CAAC;IACzE;EACJ;AACJ;AAACG,OAAA,CAAArB,eAAA,GAAAA,eAAA"} \ No newline at end of file