profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/ronag/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Robert Nagy ronag @nxtedition Malmö https://www.npmjs.com/~ronag Co-Founder @nxtedition Maintainer @CasparCG Collaborator @nodejs

nodejs/undici 1587

An HTTP/1.1 client, written from scratch for Node.js

Ethan-Arrowood/undici-fetch 108

A WHATWG Fetch implementation based on @nodejs/undici

CasparCG/media-scanner 23

A service used with CasparCG Server software for scanning media located on the server. Queried with query and thumbnail commands through CasparCG Server using AMCP.

castedo/safe-ptr 3

C++ std::shared_ptr wrapper that guarantees non-nullness

ronag/hls.js 1

JavaScript HLS client using Media Source Extension

ronag/agentkeepalive 0

Support keepalive http agent.

ronag/async-iterator-pipe 0

Pipe between async iterators and streams

ronag/busboy 0

A streaming parser for HTML form data for node.js

ronag/citgm 0

Canary in the Gold Mine

issue commentnodejs/undici

Multiple requests to the same endpoint cause an error and the container is restarted

@ronag I think we have a race condition due to the fact we are calling client.close() without a event loop run from when the stream ends.

rbonillajr

comment created time in 4 hours

pull request commentnodejs/undici

Add support to https thru an http tunnel (proxy)

Cool. Let me know if you come up with an API, I'll keep studying the codebase.

Ricardonacif

comment created time in 9 hours

Pull request review commentCasparCG/server

Allow system-audio to specify output device

 class device     }      ALCdevice* get() { return device_; }++  private:+    ALCchar* iterateDevices(const char* list)+    {+        ALCchar* result = nullptr;+        ALCchar* ptr;++        // generate ascii string for comparison purposes vs what openAL provides+        std::string short_device_name(config.audio_device_name.begin(), config.audio_device_name.end());++        ptr = (ALCchar*)list;++        CASPAR_LOG(info) << L"------- OpenAL Device List -----";++        if (!list) {+            CASPAR_LOG(info) << L"No device names found";+        } else {+            while (strlen(ptr) > 0) {+                CASPAR_LOG(info) << ptr;++                if (strcmpi(&short_device_name[0], ptr) == 0) {+                    result = ptr;+                }++                ptr += strlen(ptr) + 1;+            }+        }++        CASPAR_LOG(info) << L"------ OpenAL Devices List done -----";++        if (result != nullptr) {+            CASPAR_LOG(info) << L"--------- Found desired audio output device --------";+        } else if (strlen(&short_device_name[0]) > 0) {+            CASPAR_LOG(info) << L"--------- Desired audio output device NOT FOUND! -------- ";+        } else {+            CASPAR_LOG(info) << L"--------- Audio device not specified ----------";+        }++        return result;+    } }; -void init_device()+void init_device(configuration config) {     static std::unique_ptr<device> instance;     static std::once_flag          f; -    std::call_once(f, [] { instance = std::make_unique<device>(); });+    std::call_once(f, [&] { instance = std::make_unique<device>(config); });

I suppose, it might also be possible to, at start-up, scan the screen consumers for references to audio devices, and 'automagically' add a definition where a matching system-audio is not found?

pbelbin

comment created time in 11 hours

Pull request review commentCasparCG/server

Allow system-audio to specify output device

 class device     }      ALCdevice* get() { return device_; }++  private:+    ALCchar* iterateDevices(const char* list)+    {+        ALCchar* result = nullptr;+        ALCchar* ptr;++        // generate ascii string for comparison purposes vs what openAL provides+        std::string short_device_name(config.audio_device_name.begin(), config.audio_device_name.end());++        ptr = (ALCchar*)list;++        CASPAR_LOG(info) << L"------- OpenAL Device List -----";++        if (!list) {+            CASPAR_LOG(info) << L"No device names found";+        } else {+            while (strlen(ptr) > 0) {+                CASPAR_LOG(info) << ptr;++                if (strcmpi(&short_device_name[0], ptr) == 0) {+                    result = ptr;+                }++                ptr += strlen(ptr) + 1;+            }+        }++        CASPAR_LOG(info) << L"------ OpenAL Devices List done -----";++        if (result != nullptr) {+            CASPAR_LOG(info) << L"--------- Found desired audio output device --------";+        } else if (strlen(&short_device_name[0]) > 0) {+            CASPAR_LOG(info) << L"--------- Desired audio output device NOT FOUND! -------- ";+        } else {+            CASPAR_LOG(info) << L"--------- Audio device not specified ----------";+        }++        return result;+    } }; -void init_device()+void init_device(configuration config) {     static std::unique_ptr<device> instance;     static std::once_flag          f; -    std::call_once(f, [] { instance = std::make_unique<device>(); });+    std::call_once(f, [&] { instance = std::make_unique<device>(config); });

Hmmmm. Regarding the <system-audio> being located as a direct child of the top level element.....

Would you please explain the reasoning behind wanting to have a <system-audio> section as a top-level child section?

As with most things like this, there are many ways it could be done.

To me, the <system-audio> is a <consumer>, so it makes sense to be there, but, for multiple devices, it makes sense there'd be also an id (or perhaps just the existing device-name> used to allow multiple <system-audio> sections, and let the <screen> identify which <system-audio> it wants to use for audio output.

eg:

<consumers>
   <system-audio>
      <device-name>audio device 1</device-name>
   </system-audio>
   <system-audio>
      <device-name>audio device 2</device-name>
   </system-audio>
.
.
   <screen>
      <device>1</device>
      <system-audio-device>audio device 1</system-audio-device>
   </screen>
   <screen>
      <device>2</device>
      <system-audio-device>audio device 1</system-audio-device>
   </screen>

The above example shows 2 different video outputs, both of which are sending audio out via the audio device 1 audio output.

not sure how the management of the summing of both audio streams would be managed in this scenario, but, at least the configuration would allow it?

pbelbin

comment created time in 11 hours

Pull request review commentCasparCG/server

Allow system-audio to specify output device

 class device     }      ALCdevice* get() { return device_; }++  private:+    ALCchar* iterateDevices(const char* list)+    {+        ALCchar* result = nullptr;+        ALCchar* ptr;++        // generate ascii string for comparison purposes vs what openAL provides+        std::string short_device_name(config.audio_device_name.begin(), config.audio_device_name.end());++        ptr = (ALCchar*)list;++        CASPAR_LOG(info) << L"------- OpenAL Device List -----";++        if (!list) {+            CASPAR_LOG(info) << L"No device names found";+        } else {+            while (strlen(ptr) > 0) {+                CASPAR_LOG(info) << ptr;++                if (strcmpi(&short_device_name[0], ptr) == 0) {+                    result = ptr;+                }++                ptr += strlen(ptr) + 1;+            }+        }++        CASPAR_LOG(info) << L"------ OpenAL Devices List done -----";++        if (result != nullptr) {+            CASPAR_LOG(info) << L"--------- Found desired audio output device --------";+        } else if (strlen(&short_device_name[0]) > 0) {+            CASPAR_LOG(info) << L"--------- Desired audio output device NOT FOUND! -------- ";+        } else {+            CASPAR_LOG(info) << L"--------- Audio device not specified ----------";+        }++        return result;+    } }; -void init_device()+void init_device(configuration config) {     static std::unique_ptr<device> instance;     static std::once_flag          f; -    std::call_once(f, [] { instance = std::make_unique<device>(); });+    std::call_once(f, [&] { instance = std::make_unique<device>(config); });

Ok, I checked in a change to not allow AMCP to specify the audio device, but, I think it's creating extra work to have the audio device being indicated as a top-level thing. With the limitation that there's only allowed to be 1 audio output per instance of CasparCG when using 'system-audio', given we already have 'system-audio' being a child element of the consumer, and that we'd like to make it multi-audio device moving forward, it makes more sense to me to leave it where it is currently. The documentation should be updated to make it clear that for a system-audio output device, there can only be 1 such device (per running instance of CasparCG)), and when the time comes that multi-audio devices are supported, then this restriction will simply be relaxed. No having to move it. I didn't make 'system-audio' be where it is. But, keeping it where it is is very convenient.

pbelbin

comment created time in 11 hours

pull request commentnodejs/undici

Fix issue with util.queueMicrotask and cjs loader

@ronag not really sure how we can test it since the bug only occurs when the module is required in electron. 🤔

pgherveou

comment created time in 11 hours

issue commentnodejs/undici

Multiple requests to the same endpoint cause an error and the container is restarted

Thank you very much for the comment @mcollina In the same way, it is good that you have reported this bug as it helps to improve the library. My code is as in the documentation.

thanks.

rbonillajr

comment created time in 13 hours

issue commentnodejs/undici

Multiple requests to the same endpoint cause an error and the container is restarted

This has nothing to do with mercurius. You should be able to create a standalone scriptnto reproduce without them.

Anyway, I recommend you to create a Pool and reuse it in your resolver. It would give you the best perf and not have this problem.

rbonillajr

comment created time in 14 hours

PR merged nodejs/undici

chore: Output a Markdown table in benchmarks.

This PR adds a custom cronometro printer to output a Markdown ready table in benchmarks.

+68 -6

0 comment

1 changed file

ShogunPanda

pr closed time in 14 hours

push eventnodejs/undici

Shogun

commit sha 6c124bb5fccc29a32ab8e65baa48af1dc3ceee61

chore: Output a Markdown table in benchmarks. (#760)

view details

push time in 14 hours

pull request commentnodejs/undici

Fix issue with util.queueMicrotask and cjs loader

Codecov Report

Merging #762 (2845612) into 3.x (decdfc4) will not change coverage. The diff coverage is 50.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##              3.x     #762   +/-   ##
=======================================
  Coverage   99.49%   99.49%           
=======================================
  Files          16       16           
  Lines        1390     1390           
=======================================
  Hits         1383     1383           
  Misses          7        7           
Impacted Files Coverage Δ
lib/core/util.js 96.05% <50.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update decdfc4...2845612. Read the comment docs.

pgherveou

comment created time in 15 hours

PR opened nodejs/undici

Fix issue with util.queueMicrotask and cjs loader

👋 all. Thanks for this fantastic lib. When I require undici inside Electron and run this code

require('undici/lib/core/util.js').queueMicrotask(() => console.log('hello')) I get a Uncaught TypeError: Illegal invocation Looks like this is related to how the code is loaded via the cjs/loader

+1 -1

0 comment

1 changed file

pr created time in 16 hours

pull request commentuNetworking/uWebSockets

Allow passing any functor to cork; no need for type erasure here

I tested a more practical case, such as with cork - it does constant fold to zero cost in that case :)

JWalker1995

comment created time in 17 hours

issue closeduNetworking/uWebSockets

Revert back to function2

any_invocable that is used right now does not optimize to zero overhead, but function2 does. Reverting back to function2 would remove some overhead that shouldn't be there.

closed time in 17 hours

alexhultman-2fa

issue commentuNetworking/uWebSockets

Revert back to function2

Nope, it works.

alexhultman-2fa

comment created time in 17 hours

issue commentnodejs/undici

Favicon is missing on https://undici.nodejs.org/#/

PR merged and favicon is on the live site. This issue should be closed.

dgonzalez

comment created time in 18 hours

push eventnodejs/undici

delivey

commit sha 9fe083aa4563a4c62e5255255ba00a8d540da2b1

added favicon to index.html (#758)

view details

push time in 18 hours

PR merged nodejs/undici

Added favicon to index.html

Added favicon to index.html, so it would show up on https://undici.nodejs.org/ Issue: https://github.com/nodejs/undici/issues/657

+2 -0

1 comment

1 changed file

delivey

pr closed time in 18 hours

push eventnodejs/undici

Anish Shobith P S

commit sha 6f90dddf9e0a75f14b7fccf505d4443537d13a88

fix: exports of `index.d.ts` (#759)

view details

push time in 20 hours

PR merged nodejs/undici

Reviewers
fix: exports of `index.d.ts`

This pr properly exports index.d.ts which was not exported previously.

Closes #757

+2 -1

1 comment

1 changed file

Anish-Shobith

pr closed time in 20 hours

issue closednodejs/undici

types: index.d.ts is not exported

Bug Description

From what i see in the package.json under files there is option to include .d.ts file but unfortunately the dist or the code in npm does not include index.d.ts, which forces us to types from directly from the types folder which shouldn't be the case.

https://github.com/nodejs/undici/blob/29682079eeeb918a35b02a6ef06156cb8f74b2d1/package.json#L25

Reproducible By

The way to check if index.d.ts is included or not by running a dry run test npm publish --dry-run

Expected Behavior

index.d.ts should be exported.

https://github.com/nodejs/undici/blob/29682079eeeb918a35b02a6ef06156cb8f74b2d1/package.json#L24-L29 Fix:

+ "*.d.ts",
+ "index.js",
- "index.(js|.d.ts)"
  "files": [
    "*.d.ts",
    "index.(js|.d.ts)",
    "lib",
    "types",
    "docs"
  ],

Logs & Screenshots

Console Logs:

Output of log without including index.d.ts : https://sourceb.in/AVrVZ2g12h

image

Output of log with including index.d.ts : https://sourceb.in/XAbWszsZ0M image

Environment

N/A

Additional context

None

closed time in 20 hours

Anish-Shobith

issue openeduNetworking/uWebSockets

Revert back to function2

any_invocable that is used right now does not optimize to zero overhead, but function2 does. Reverting back to function2 would remove some overhead that shouldn't be there.

created time in 21 hours

pull request commentuNetworking/uWebSockets

Allow passing any functor to cork; no need for type erasure here

I pasted an example in compilerexplorer and it did actually not compile down to nothing - but with "function2" (another implementation) it did. So technically I'm wrong, but a solution would be to revert back to using function2 rather than put in specialized cases.

JWalker1995

comment created time in 21 hours

pull request commentnodejs/undici

Add support to https thru an http tunnel (proxy)

Cool, there I have the TLS socket as conn, but how would I go about using the higher level API client.request({ method: 'GET', path: '/'}) from this point on? Right now, the client.connect method is the one that creates either the TCP socket or the TLS socket depending on the protocol. We would need it to create the TCP socket first, and onConnect upgrade it to the TLS socket. Would it make sense to add an option to the connect method to do this?

Ricardonacif

comment created time in 21 hours

issue commentnodejs/undici

Multiple requests to the same endpoint cause an error and the container is restarted

I only tested with v3.3.3 and v4.0.0-alpha.3. Both give me error.

rbonillajr

comment created time in a day

issue commentnodejs/undici

Multiple requests to the same endpoint cause an error and the container is restarted

I did not try with master. I do the test and I comment.

rbonillajr

comment created time in a day

issue commentnodejs/undici

Multiple requests to the same endpoint cause an error and the container is restarted

The problem doesn't happen when i run locally. It happens to me only in the k8s pod.

The error comes up when you execute the fetch function (I attach the code)

export const fetch = async (url: string, options: Client.RequestOptions) => {
  const client = new Client(url);
  const response = await client.request(options);
  let data = '';
  for await (const chunk of response.body) {
    data += String(chunk);
  }

  client.close();
  return { ...response, body: data };
};
rbonillajr

comment created time in a day