Skip to content

1049 bug random 2v2 rooms are hidden from players looking for a teammate - #1051

Merged
CapoMK25 merged 6 commits into
devfrom
1049-bug-random-2v2-rooms-are-hidden-from-players-looking-for-a-teammate
Oct 27, 2026
Merged

CapoMK25 merged 6 commits into
devfrom
1049-bug-random-2v2-rooms-are-hidden-from-players-looking-for-a-teammate

Conversation

@tickBit

@tickBit tickBit commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Brief description

Related issue #1049

Fixes Random 2v2 room discovery so players can find and join rooms that still have an available real-player slot.

A bot-filled READY room remains joinable because the joining player replaces the bot. Room joins are protected with a Redis lock to prevent concurrent requests from taking the same final slot.

Change list

  • Added a shared check for determining whether a matchmaking room can accept another real player.
  • Made joinable RANDOM rooms visible to other players through GET /matchmaking/rooms.
  • Kept full, QUEUED, MATCHED, and CANCELLED Random rooms hidden from players outside the room.
  • Preserved queued-room visibility for the room owner and existing members.
  • Preserved the existing Clan and Custom room visibility rules.
  • Added a per-room Redis lock for join operations.
  • Added atomic lock release to prevent one request from releasing another request’s lock.
  • Prevented concurrent join requests from exceeding the room’s real-player capacity.
  • Kept bot replacement behavior when a real player joins a bot-filled room.
  • Added tests for Random room visibility, bot replacement, full and queued rooms, completed and cancelled rooms, existing Clan and Custom behavior, and concurrent joins.
  • Updated the matchmaking API documentation with the new visibility and joining rules.

Testing

After player 1 has created a match, player B (from same clan) can see the room with GET /matchmaking/rooms and also player C (from different clan):

{
    "data": {
        "Object": [
            {
                "id": "6ae04bfe84585a17b60a584f",
                "matchType": "RANDOM",
                "gameType": 1,
                "status": "READY",
                "ownerPlayerId": "69ef8b7332f46bd743f4c54e",
                "players": [
                    "69ef8b7332f46bd743f4c54e"
                ],
                "bots": [
                    {
                        "botId": "6ae04bfe84585a17b60a584f:bot:1",
                        "displayName": "Bot 1",
                        "isBot": true
                    }
                ],
                "teamSize": 2,
                "allowBots": true,
                "createdAt": "2026-10-27T07:00:14.225Z",
                "updatedAt": "2026-10-27T07:00:14.225Z",
                "readyAt": "2026-10-27T07:00:14.225Z"
            }
        ]
    },
    "metaData": {
        "dataKey": "Object",
        "modelName": "Object",
        "dataType": "Array",
        "dataCount": 1
    }
}

@codecov-alt

codecov-alt Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.46154% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/common/service/redis/redis.service.ts 0.00% 3 Missing ⚠️
Files with missing lines Coverage Δ
src/matchmaking/matchmaking.service.ts 91.44% <100.00%> (ø)
src/common/service/redis/redis.service.ts 7.40% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@CapoMK25 CapoMK25 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solid work, approved!

@github-project-automation github-project-automation Bot moved this from Backlog to Done in Altzone-Server Oct 27, 2026
@CapoMK25
CapoMK25 merged commit 299e5dd into dev Oct 27, 2026
5 checks passed
@CapoMK25
CapoMK25 deleted the 1049-bug-random-2v2-rooms-are-hidden-from-players-looking-for-a-teammate branch October 27, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Bug: Random 2v2 rooms are hidden from players looking for a teammate

2 participants