#Random shutdowns due to sessionInfo being null

35 messages · Page 1 of 1 (latest)

brisk prawn
#
/nova/node_modules/.pnpm/discord.js@14.15.3_bufferutil@4.0.8/node_modules/discord.js/src/client/websocket/handlers/RESUMED.js:6
2024-07-26T21:20:46.348970429Z   const replayed = shard.sessionInfo.sequence - shard.closeSequence;
2024-07-26T21:20:46.348991867Z                                      ^
2024-07-26T21:20:46.349006540Z 
2024-07-26T21:20:46.349021077Z TypeError: Cannot read properties of null (reading 'sequence')
2024-07-26T21:20:46.349035112Z     at module.exports [as RESUMED] (/nova/node_modules/.pnpm/discord.js@14.15.3_bufferutil@4.0.8/node_modules/discord.js/src/client/websocket/handlers/RESUMED.js:6:38)
2024-07-26T21:20:46.349106501Z     at WebSocketManager.handlePacket (/nova/node_modules/.pnpm/discord.js@14.15.3_bufferutil@4.0.8/node_modules/discord.js/src/client/websocket/WebSocketManager.js:355:31)
2024-07-26T21:20:46.349126391Z     at WebSocketManager.<anonymous> (/nova/node_modules/.pnpm/discord.js@14.15.3_bufferutil@4.0.8/node_modules/discord.js/src/client/websocket/WebSocketManager.js:239:12)
2024-07-26T21:20:46.349142713Z     at WebSocketManager.emit (/nova/node_modules/.pnpm/@vladfrangu+async_event_emitter@2.4.4/node_modules/@vladfrangu/async_event_emitter/src/index.ts:508:28)
2024-07-26T21:20:46.349157516Z     at LumiWorkerStrategy.onMessage (/nova/node_modules/.pnpm/@discordjs+ws@1.1.1_bufferutil@4.0.8/node_modules/@discordjs/ws/src/strategies/sharding/WorkerShardingStrategy.ts:296:18)
2024-07-26T21:20:46.349171900Z     at Worker.<anonymous> (/nova/node_modules/.pnpm/@discordjs+ws@1.1.1_bufferutil@4.0.8/node_modules/@discordjs/ws/src/strategies/sharding/WorkerShardingStrategy.ts:234:17)
2024-07-26T21:20:46.349187167Z     at Worker.emit (node:events:520:28)
2024-07-26T21:20:46.349201254Z     at MessagePort.<anonymous> (node:internal/worker:267:53)
2024-07-26T21:20:46.349215684Z     at [nodejs.internal.kHybridDispatch] (node:internal/event_target:816:20)
2024-07-26T21:20:46.349230010Z     at MessagePort.<anonymous> (node:internal/per_context/messageport:23:28)
2024-07-26T21:20:46.349266983Z 
2024-07-26T21:20:46.349284055Z Node.js v22.5.1
fair plinthBOT
#
  • What's your exact discord.js npm list discord.js and node node -v version?
  • Not a discord.js issue? Check out #1081585952654360687.
  • Consider reading #how-to-get-help to improve your question!
  • Explain what exactly your issue is.
  • Post the full error stack trace, not just the top part!
  • Show your code!
  • Issue solved? Press the button!
  • Marked as resolved by OP
brisk prawn
#

*i have no resolution overrides at all for any dependency

olive axle
#

What is LumiWorkerStrategy there?

brisk prawn
olive axle
#

Show that custom extension then, as I expect it to be the source of your issue

brisk prawn
#

I believe not

#

I am not allowed to, all it does is manually specify workerPath

olive axle
#

You can do that with the standard worker strategy already though Thonk

brisk prawn
#

This only happens on shard resume

#

Which is handled by mainlib

olive axle
#

Well, not exclusively. Because the resume is done in /ws and then emitted to mainlib which then checks data sent from /ws on connect to mainlib prior. So that strategy plays a crucial part in finding that issue

brisk prawn
#

I am aware

#

I patched the packet handler on pnpm n it seems to be fine

olive axle
#

You‘re completely outside of support then… manually editing djs internals is a bad idea, instead fixing the original issue would be the better approach

brisk prawn
#

No I only did this after this error came up

olive axle
#

That doesn’t change what I said though

#

If anything you made it not throw an error anymore, but still got broken behavior because a resume without session data is just wrong

brisk prawn
#

It does have session data

olive axle
#

The error indicates otherwise

brisk prawn
#

After the patch

#

That error is before the patch

#

And this behavior is after the patch

olive axle
#

What did you patch?

brisk prawn
#

The resumed event on mainlib I think

#

Let me check

olive axle
#

What exactly, as in what changes to that file did you make

brisk prawn
olive axle
#

But it‘s not that sequence is missing… it‘s that sessionInfo is null. So contrary to your claim the sessionInfo is indeed missing. And you just made it ignore that wrong behavior instead of fixing the issue

#

So expect other issues in the future and don’t come here for support in those cases. Or fix the actual issue (which I‘ll gladly assist in if wanted)

brisk prawn
#

is its presence crucial for functionality?

#

oh, i figured out the issue