From fcdd3af58aded70ca222d68b475ef6ce7612478c Mon Sep 17 00:00:00 2001 From: Garrett Jensen Date: Wed, 31 Jan 2024 09:27:44 -0500 Subject: [PATCH] switch to queue microtask --- package.json | 2 +- src/platform/browser/process.js | 4 ++-- test/jingle/sdp/audio-video.json | 18 ++++++++++++++++++ 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index d6b0b310..b9f15ecc 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "stanza", + "name": "stanza-genesys", "description": "Modern XMPP in the browser, with a JSON API", "version": "12.19.1", "author": "Lance Stout ", diff --git a/src/platform/browser/process.js b/src/platform/browser/process.js index 2e0f29b0..4a75507a 100644 --- a/src/platform/browser/process.js +++ b/src/platform/browser/process.js @@ -31,7 +31,7 @@ function drainQueue() { if (draining) { return; } - var timeout = setTimeout(cleanUpNextTick, 0); + var timeout = queueMicrotask(cleanUpNextTick, 0); draining = true; var len = queue.length; @@ -60,6 +60,6 @@ exports.nextTick = function (fun) { } queue.push(new Item(fun, args)); if (queue.length === 1 && !draining) { - setTimeout(drainQueue, 0); + queueMicrotask(drainQueue, 0); } }; diff --git a/test/jingle/sdp/audio-video.json b/test/jingle/sdp/audio-video.json index d876ef96..6548b8c1 100644 --- a/test/jingle/sdp/audio-video.json +++ b/test/jingle/sdp/audio-video.json @@ -168,12 +168,14 @@ "fecMechanisms": [], "headerExtensions": [ { + "attributes": "", "id": 1, "direction": "sendrecv", "uri": "urn:ietf:params:rtp-hdrext:ssrc-audio-level", "attributes": "" }, { + "attributes": "", "id": 2, "direction": "sendrecv", "uri": "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time", @@ -181,24 +183,28 @@ }, { "id": 3, + "attributes": "", "direction": "sendrecv", "uri": "http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01", "attributes": "" }, { "id": 4, + "attributes": "", "direction": "sendrecv", "uri": "urn:ietf:params:rtp-hdrext:sdes:mid", "attributes": "" }, { "id": 5, + "attributes": "", "direction": "sendrecv", "uri": "urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id", "attributes": "" }, { "id": 6, + "attributes": "", "direction": "sendrecv", "uri": "urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id", "attributes": "" @@ -856,72 +862,84 @@ "headerExtensions": [ { "id": 14, + "attributes": "", "direction": "sendrecv", "uri": "urn:ietf:params:rtp-hdrext:toffset", "attributes": "" }, { "id": 2, + "attributes": "", "direction": "sendrecv", "uri": "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time", "attributes": "" }, { "id": 13, + "attributes": "", "direction": "sendrecv", "uri": "urn:3gpp:video-orientation", "attributes": "" }, { "id": 3, + "attributes": "", "direction": "sendrecv", "uri": "http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01", "attributes": "" }, { "id": 12, + "attributes": "", "direction": "sendrecv", "uri": "http://www.webrtc.org/experiments/rtp-hdrext/playout-delay", "attributes": "" }, { "id": 11, + "attributes": "", "direction": "sendrecv", "uri": "http://www.webrtc.org/experiments/rtp-hdrext/video-content-type", "attributes": "" }, { "id": 7, + "attributes": "", "direction": "sendrecv", "uri": "http://www.webrtc.org/experiments/rtp-hdrext/video-timing", "attributes": "" }, { "id": 8, + "attributes": "", "direction": "sendrecv", "uri": "http://tools.ietf.org/html/draft-ietf-avtext-framemarking-07", "attributes": "" }, { "id": 9, + "attributes": "", "direction": "sendrecv", "uri": "http://www.webrtc.org/experiments/rtp-hdrext/color-space", "attributes": "" }, { "id": 4, + "attributes": "", "direction": "sendrecv", "uri": "urn:ietf:params:rtp-hdrext:sdes:mid", "attributes": "" }, { "id": 5, + "attributes": "", "direction": "sendrecv", "uri": "urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id", "attributes": "" }, { "id": 6, + "attributes": "", "direction": "sendrecv", "uri": "urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id", "attributes": ""