braid-http 1.3.55 → 1.3.56

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.
@@ -947,12 +947,23 @@ async function create_multiplexer(origin, mux_key, params, mux_params, attempt)
947
947
  if (!try_deleting.has(request)) {
948
948
  try_deleting.add(request)
949
949
  try {
950
+ var mux_was_done = await promise_done(mux_promise)
951
+
950
952
  var r = await braid_fetch(`${origin}/.well-known/multiplexer/${multiplexer}/${request}`, {
951
953
  method: 'DELETE',
952
954
  headers: { 'Multiplex-Version': multiplex_version },
953
955
  retry: true
954
956
  })
955
957
 
958
+ // if we know the multiplexer was created,
959
+ // but it isn't there now,
960
+ // and our client doesn't realize it,
961
+ // then shut it down ourselves
962
+ if (r.status === 404 && r.headers.get('Bad-Multiplexer')
963
+ && mux_was_done && !mux_error) {
964
+ cleanup_multiplexer(new Error('multiplexer detected to be closed'))
965
+ }
966
+
956
967
  if (!r.ok) throw new Error('status not ok: ' + r.status)
957
968
  if (r.headers.get('Multiplex-Version') !== multiplex_version)
958
969
  throw new Error('wrong multiplex version: '
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "braid-http",
3
- "version": "1.3.55",
3
+ "version": "1.3.56",
4
4
  "description": "An implementation of Braid-HTTP for Node.js and Browsers",
5
5
  "scripts": {
6
6
  "test": "node test/server.js"