Skip to content

Maximum call stack size exceeded when account has many friends #540

Description

@Luc4sguilherme

Describe the bug

When using a Steam account with many friends, the application throws the following error:

Exception in PromiseRejectCallback:
/node-stdlib/node-steam-user/components/friends.js:1038
                                        release();
                                        ^
RangeError: Maximum call stack size exceeded

The issue can be reproduced by simulating a large payload in the ClientPersonaState handler. For example:

SteamUserBase.prototype._handlerManager.add(EMsg.ClientPersonaState, function(body) {
	body.friends = Array.from({ length: 2000 }, (_, i) => ({
		friendid: i + 1,
		avatar_hash: new Uint8Array([188, 109, 70, 96, 135, 190, 63, 19, 173, 215, 49, 59, 17, 135, 183, 155, 244, 83, 7, 71]),
		last_logoff: 1776693948,
		last_logon: 1776693965,
		last_seen_online: 1776693948,
		gameid: null,
		rich_presence: [],
	}));


	body.friends.forEach((u) => {

Versions

v5.2.3

Screenshots and Error Logs

Image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions