You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Number('') makes an empty members/maxMembers render as 0 / 8 in the room #823
An empty members/maxMembers is shown as a real zero.
plugins/social/client.js:895-899:
const members = seen.members === undefined || seen.members === null ? NaN : Number(seen.members)
const maxMembers = seen.maxMembers === undefined || seen.maxMembers === null ? NaN : Number(seen.maxMembers)
const people = Number.isFinite(members) && Number.isFinite(maxMembers) ? `${members} / ${maxMembers} in the room` : …
Number('') is 0 (and so is Number(' ')), and '' is neither undefined nor null, so a server that sends an empty string produces 0 / 8 in the room — a room that looks empty when the count is simply unknown.
Expected behaviour
Only a value that actually reads as a number counts: a trimmed, non-empty string that parses to a finite number. '', ' ', 'eight' are "not sent" — the line falls back the same way it does for null. A real 0 (0 or '0') still renders 0 / 8, because an empty room is a real state.
Acceptance
A fixture with members: '', maxMembers: 8 renders no 0 / 8 (the members half is treated as missing, so the one-number fallback applies, or the line disappears if both are missing).
A fixture with members: '0', maxMembers: 8 renders 0 / 8 in the room.
Whitespace (' 8 ') is either trimmed to 8 or treated as missing — pinned by a test either way, not left ambiguous.
npm test in plugins/social green.
Kill conditions
Number(x) || NaN: turns a legitimate 0 into "missing".
parseInt: accepts '8abc' as 8.
Requiring both numbers before showing anything: that changes the one-number behaviour the issue asked for.
Fixing it in the server by sanitising the payload: the client already receives arbitrary values from older servers.
Out of scope
cleanRoomName's marker loop and the repeat-preview item.
Claiming #823 for branch fix/823-empty-members-count (head repo HugoXK/FlyBot, PR against ThinkFlowLab/FlyBotmain). Scope kept to plugins/social/client.js and one pinned test: a trimmed, non-empty value that parses to a finite number counts; ''/' '/non-numeric fall back to missing; a real 0 still renders.
Activity
HugoXK commentedon Oct 23, 2026
Written-by: Dev-3
Claiming #823 for branch
fix/823-empty-members-count(head repo HugoXK/FlyBot, PR againstThinkFlowLab/FlyBotmain). Scope kept toplugins/social/client.jsand one pinned test: a trimmed, non-empty value that parses to a finite number counts;''/' '/non-numeric fall back to missing; a real0still renders.