Compare commits

...

8 Commits

Author SHA1 Message Date
Alex Corn
08d14f19e6 3.50.2 2026-07-12 17:18:42 -04:00
DoctorMcKay
cfed757eab Merge pull request #369 from lrftw/fix/login-timeout
Fix login hanging indefinitely on steam-session timeout
2026-07-12 17:09:58 -04:00
DoctorMcKay
63defbb643 Merge pull request #370 from GVRLNKMK/fix-ceconitem-tradable-after-crash
Fix CEconItem crash when "Tradable/Marketable After" date isn't day-first
2026-07-12 17:09:19 -04:00
GVRLNKMK
6e20fbe299 Fix CEconItem crash when Tradable/Marketable After date isn't day-first
CEconItem destructured the day-first date regex match without a null
check, throwing 'match is not iterable' for CS2 items whose
owner_descriptions use the legacy month-first format (e.g. 'Tradable/
Marketable After Jul 11, 2025 (2:00:00)'). Running in the constructor,
this made getInventoryContents()/getUserInventoryContents() reject the
whole inventory.

Guard the null match, fall back to parsing the legacy month-first
format, and only set cache_expiration for a valid date. Day-first
strings are unchanged; backwards-compatible.
2026-07-10 17:25:18 +03:00
Lucas
59090242f9 Fix login hanging indefinitely on steam-session timeout
Modern login in components/login.js listens for 'authenticated' and
'error' events from steam-session's LoginSession, but not the 'timeout'
event. When loginTimeout (default 30s) elapses, steam-session emits
'timeout' and calls cancelLoginAttempt() without emitting an 'error'
event, causing the Promise to never settle and the login callback to
never be called.

Add a 'timeout' event listener that rejects the Promise with a
descriptive error.
2026-07-03 10:02:04 +02:00
Alex Corn
00e82f7e79 3.50.1 2026-06-28 17:48:51 -04:00
DoctorMcKay
7b901b147b Merge pull request #367 from ricardocefet2018/master
fix: Invalid time value
2026-06-28 17:44:21 -04:00
Ricardo Rocha
0f7fc98ab5 fix: Invalid time value 2026-06-26 19:14:28 -03:00
3 changed files with 24 additions and 4 deletions

View File

@@ -68,10 +68,26 @@ function CEconItem(item, description, contextID, assetProperties) {
// Restore cache_expiration, if we can (for CS:GO items)
if (this.appid == 730 && this.contextid == 2 && this.owner_descriptions) {
let description = this.owner_descriptions.find(d => d.value && d.value.indexOf('Tradable/Marketable After ') == 0);
let description = this.owner_descriptions.find((d) => d.value && d.value.indexOf("Tradable/Marketable After ") == 0);
if (description) {
let date = new Date(description.value.substring(26).replace(/[,()]/g, ''));
if (date) {
let date;
const match = description.value.match(/(\d{1,2}) (\w+) @ (\d{1,2}:\d{2})(am|pm)/i);
if (match) {
// New day-first format, e.g. "Tradable/Marketable After 17 Jul @ 3:00am"
const [, day, month, time, meridian] = match;
const now = new Date();
let year = now.getFullYear();
date = new Date(`${day} ${month} ${year} ${time} ${meridian}`);
if (date.getTime() < now.getTime()) {
date = new Date(`${day} ${month} ${year + 1} ${time} ${meridian}`);
}
} else {
// Legacy month-first format, e.g. "Tradable/Marketable After Jul 11, 2025 (2:00:00)"
date = new Date(description.value.substring("Tradable/Marketable After ".length).replace(/[,()]/g, ""));
}
if (date && !isNaN(date.getTime())) {
this.cache_expiration = date.toISOString();
}
}

View File

@@ -68,6 +68,10 @@ SteamCommunity.prototype._modernLogin = function(logOnDetails) {
reject(err);
});
session.on('timeout', () => {
reject(new Error('Login timed out'));
});
try {
let startResult = await session.startWithCredentials({
accountName: logOnDetails.accountName,

View File

@@ -1,6 +1,6 @@
{
"name": "steamcommunity",
"version": "3.50.0",
"version": "3.50.2",
"description": "Provides an interface for logging into and interacting with the Steam Community website",
"files": [
"/classes",