minecraft-launcher-core-node icon indicating copy to clipboard operation
minecraft-launcher-core-node copied to clipboard

Connections don't get limited

Open SrIzan10 opened this issue 1 year ago • 3 comments

Connections don't get limited when installing.

const agent = new Agent({ connections: 1 })
const instTask = installTask(installer, minecraftLocation, { agent: resolveAgent({ dispatcher: agent }) })

Errors:

[1]   [errors]: [
[1]     ConnectTimeoutError: Connect Timeout Error
[1]         at onConnectTimeout (C:\Users\USER\Desktop\Development\pmc-launcher\node_modules\undici\lib\core\connect.js:186:24)   
[1]         at C:\Users\USER\Desktop\Development\pmc-launcher\node_modules\undici\lib\core\connect.js:133:46
[1]         at Immediate._onImmediate (C:\Users\USER\Desktop\Development\pmc-launcher\node_modules\undici\lib\core\connect.js:172:33)
[1]         at process.processImmediate (node:internal/timers:476:21) {
[1]       code: 'UND_ERR_CONNECT_TIMEOUT',
[1]       url: 'https://piston-meta.mojang.com/v1/packages/12888726d2cc035d30965bcf8c825c7ac5f28ea0/1.20.2.json'
[1]     }
[1]   ]
[1] }
...

SrIzan10 avatar Nov 19 '23 12:11 SrIzan10

On my side I'm doing the same for installAssetsTask, I just don't have the resolveAgent, try removing it maybe.

Nogitsu avatar Nov 19 '23 13:11 Nogitsu

oh, okay! then it looks like the types are wrong: Type '{ dispatcher: Agent; }' is missing the following properties from type 'DownloadAgent': retryHandler, rangePolicy, checkpointHandler, head, dispatchts(2739)

SrIzan10 avatar Nov 19 '23 15:11 SrIzan10

I believe the issue is still there, after a few installation attempts it just times out. Is it related to this issue?

SrIzan10 avatar Nov 19 '23 15:11 SrIzan10