Skip to content

Conversation

@angelayu0530
Copy link
Collaborator

@angelayu0530 angelayu0530 commented Jan 4, 2026

566

566

changed so expire at is null when creating and then sets a expire at when starts

Description of changes

Checklist before review

  • I have done a thorough self-review of the PR
  • Copilot has reviewed my latest changes, and all comments have been fixed and/or closed.
  • If I have made database changes, I have made sure I followed all the db repo rules listed in the wiki here. (check if no db changes)
  • All tests have passed
  • I have successfully deployed this PR to staging
  • I have done manual QA in both dev (and staging if possible) and attached screenshots below.

Screenshots

Staging

When Create Party:
Screenshot 2026-01-04 at 9 27 15 PM
When Started
Screenshot 2026-01-04 at 9 27 28 PM

@angelayu0530
Copy link
Collaborator Author

/deploy

@github-actions
Copy link

github-actions bot commented Jan 4, 2026

The command to deploy to staging for the commit fe75603 has been triggered. View action run

@github-actions
Copy link

github-actions bot commented Jan 4, 2026

Staging deployment failed for commit fe75603

**

View run

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 4, 2026

Greptile Summary

Changed party lifecycle so expiresAt is null on creation and set to 30 minutes when the duel starts via DuelManager.startDuel().

Key changes:

  • PartyManager.createParty() now sets expiresAt to null instead of now() + 30 minutes
  • DuelManager.startDuel() sets expiresAt to now() + 30 minutes when transitioning lobby from AVAILABLE to ACTIVE
  • Added null checks in PartyManager.joinParty() and DuelManager.endDuel() to handle expiresAt being null
  • Removed unused OffsetDateTime import from PartyManager.java

Issues found:

  • Tests in PartyManagerTest.java (lines 72 and 153-177) will fail because they expect expiresAt to be set on party creation

Confidence Score: 2/5

  • Tests will fail - requires test updates before merge
  • Logic changes are correct and properly handle null checks, but existing tests assert expiresAt is not null on party creation, which will cause test failures
  • PartyManagerTest.java needs updates to align with the new behavior where expiresAt is null on party creation

Important Files Changed

Filename Overview
src/main/java/com/patina/codebloom/common/components/duel/PartyManager.java Changed expiresAt to null on party creation; removed unused import
src/main/java/com/patina/codebloom/common/components/duel/DuelManager.java Sets expiresAt to 30 minutes when duel starts; adds null check in endDuel

Sequence Diagram

sequenceDiagram
    participant User
    participant PartyManager
    participant DuelManager
    participant Lobby
    participant LobbyRepository

    Note over User,LobbyRepository: Party Creation Flow
    User->>PartyManager: createParty(userId)
    PartyManager->>LobbyRepository: createLobby(lobby)
    Note over Lobby: expiresAt = null
    Note over Lobby: status = AVAILABLE
    LobbyRepository-->>PartyManager: success
    PartyManager-->>User: joinCode

    Note over User,LobbyRepository: Duel Start Flow
    User->>DuelManager: startDuel(playerId)
    DuelManager->>LobbyRepository: findLobbyById(lobbyId)
    LobbyRepository-->>DuelManager: lobby
    DuelManager->>Lobby: setStatus(ACTIVE)
    DuelManager->>Lobby: setExpiresAt(now + 30 minutes)
    DuelManager->>LobbyRepository: updateLobby(lobby)
    LobbyRepository-->>DuelManager: success
    DuelManager-->>User: duel started

    Note over User,LobbyRepository: Join Party Flow
    User->>PartyManager: joinParty(userId, partyCode)
    PartyManager->>LobbyRepository: findAvailableLobbyByJoinCode(partyCode)
    LobbyRepository-->>PartyManager: lobby
    alt expiresAt != null AND expired
        PartyManager-->>User: DuelException: lobby expired
    else valid
        PartyManager->>LobbyRepository: updateLobby(lobby)
        PartyManager-->>User: joined successfully
    end

    Note over User,LobbyRepository: End Duel Flow
    User->>DuelManager: endDuel(lobbyId, isDuelCleanup)
    DuelManager->>LobbyRepository: findLobbyById(lobbyId)
    LobbyRepository-->>DuelManager: lobby
    alt expiresAt != null AND not expired AND not cleanup
        DuelManager-->>User: DuelException: not ready for expiration
    else can end
        DuelManager->>Lobby: setStatus(COMPLETED)
        DuelManager->>LobbyRepository: updateLobby(lobby)
        DuelManager-->>User: duel ended
    end
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

2 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@github-actions
Copy link

github-actions bot commented Jan 4, 2026

Commit Validation Failed

The following commits do not start with the required Notion ID 566:

spotless

Please rebase and update your commit messages.
All messages should be of the following format: 566: Example commit

@angelayu0530
Copy link
Collaborator Author

/deploy

@github-actions
Copy link

github-actions bot commented Jan 4, 2026

The command to deploy to staging for the commit 6c995c4 has been triggered. View action run

@github-actions
Copy link

github-actions bot commented Jan 4, 2026

Staging deployment failed for commit 6c995c4

**

View run

@github-actions
Copy link

github-actions bot commented Jan 4, 2026

Commit Validation Failed

The following commits do not start with the required Notion ID 566:

test errors

Please rebase and update your commit messages.
All messages should be of the following format: 566: Example commit

@angelayu0530
Copy link
Collaborator Author

/deploy

@github-actions
Copy link

github-actions bot commented Jan 4, 2026

The command to deploy to staging for the commit 7e5113f has been triggered. View action run

@github-actions
Copy link

github-actions bot commented Jan 4, 2026

Overall Project 72.48% 🍏
Files changed 100% 🍏

File Coverage
PartyManager.java 92.94% 🍏
DuelManager.java 92.15% 🍏

@github-actions
Copy link

github-actions bot commented Jan 4, 2026

Overall Project 72.48% 🍏
Files changed 100% 🍏

File Coverage
PartyManager.java 92.94% 🍏
DuelManager.java 92.15% 🍏

@github-actions
Copy link

github-actions bot commented Jan 4, 2026

Staging deployment succeeded for commit 7e5113f

View run

@angelayu0530
Copy link
Collaborator Author

/deploy

@github-actions
Copy link

github-actions bot commented Jan 4, 2026

The command to deploy to staging for the commit 9a5d1e0 has been triggered. View action run

@github-actions
Copy link

github-actions bot commented Jan 4, 2026

Staging deployment failed for commit 9a5d1e0

**

View run

@github-actions
Copy link

github-actions bot commented Jan 5, 2026

Commit Validation Failed

The following commits do not start with the required Notion ID 566:

spotless changes

Please rebase and update your commit messages.
All messages should be of the following format: 566: Example commit

@angelayu0530
Copy link
Collaborator Author

/deploy

@github-actions
Copy link

github-actions bot commented Jan 5, 2026

The command to deploy to staging for the commit 03a7ba3 has been triggered. View action run

@github-actions
Copy link

github-actions bot commented Jan 5, 2026

Overall Project 72.47% 🍏
Files changed 100% 🍏

File Coverage
PartyManager.java 92.89% 🍏
DuelManager.java 92.15% 🍏

@github-actions
Copy link

github-actions bot commented Jan 5, 2026

Staging deployment succeeded for commit 03a7ba3

View run

@angelayu0530
Copy link
Collaborator Author

/deploy

@github-actions
Copy link

github-actions bot commented Jan 5, 2026

The command to deploy to staging for the commit 48224b4 has been triggered. View action run

@github-actions
Copy link

github-actions bot commented Jan 5, 2026

Staging deployment failed for commit 1716814

**

View run

@angelayu0530
Copy link
Collaborator Author

/deploy

@github-actions
Copy link

github-actions bot commented Jan 5, 2026

The command to deploy to staging for the commit 4c9a85e has been triggered. View action run

@github-actions
Copy link

github-actions bot commented Jan 5, 2026

Staging deployment failed for commit 4c9a85e

**

View run

@angelayu0530
Copy link
Collaborator Author

/deploy

@github-actions
Copy link

github-actions bot commented Jan 5, 2026

The command to deploy to staging for the commit b76be29 has been triggered. View action run

@github-actions
Copy link

github-actions bot commented Jan 5, 2026

Staging deployment failed for commit b76be29

**

View run

@angelayu0530
Copy link
Collaborator Author

/deploy

@github-actions
Copy link

github-actions bot commented Jan 5, 2026

The command to deploy to staging for the commit c031856 has been triggered. View action run

@github-actions
Copy link

github-actions bot commented Jan 5, 2026

Staging deployment failed for commit c031856

**

View run

@angelayu0530
Copy link
Collaborator Author

/deploy

@github-actions
Copy link

github-actions bot commented Jan 5, 2026

The command to deploy to staging for the commit 2b7b0e2 has been triggered. View action run

@github-actions
Copy link

github-actions bot commented Jan 5, 2026

Overall Project 74.69% 🍏
Files changed 98.44% 🍏

File Coverage
PartyManager.java 100% 🍏
DuelManager.java 92.1% 🍏
LobbySqlRepository.java 86.69% -0.14% 🍏

@github-actions
Copy link

github-actions bot commented Jan 5, 2026

Staging deployment succeeded for commit 2b7b0e2

View run

… once duel starts

spotless

test errors

 bug fix

spotless changes

forgot db migration

had to update lobby repo
changes

changes

spotless

testing

changes

test changes

spotless

pr changes
@angelayu0530 angelayu0530 enabled auto-merge (rebase) January 5, 2026 06:36
@github-actions
Copy link

github-actions bot commented Jan 5, 2026

Overall Project 76.79% 🍏
Files changed 98.33% 🍏

File Coverage
PartyManager.java 100% 🍏
DuelManager.java 92.1% 🍏
LobbySqlRepository.java 86.69% -0.14% 🍏

@angelayu0530 angelayu0530 merged commit 25ddaa0 into main Jan 5, 2026
12 checks passed
@angelayu0530 angelayu0530 deleted the sse-end-change branch January 5, 2026 06:43
@github-actions
Copy link

github-actions bot commented Jan 5, 2026

Overall Project 76.79% 🍏
Files changed 98.33% 🍏

File Coverage
PartyManager.java 100% 🍏
DuelManager.java 92.1% 🍏
LobbySqlRepository.java 86.69% -0.14% 🍏

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants