Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds player heartbeat processing functionality to track active player sessions. However, there is a typo in the PR title: "hearbeat" should be "heartbeat".
Changes:
- Added
last_seen_attimestamp tracking to player sessions with database migration and index - Implemented batch heartbeat endpoint to update session activity timestamps
- Added scheduled cleanup job to remove stale sessions based on configurable TTL
- Enhanced login flow to handle stale session detection and removal
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/resources/db/migration/V1__create_player_sessions.sql | Added last_seen_at column with default value and index for efficient stale session queries |
| src/main/kotlin/gg/grounds/domain/PlayerSession.kt | Extended domain model to include lastSeenAt timestamp |
| src/main/kotlin/gg/grounds/persistence/PlayerSessionRepository.kt | Added touchSessions for batch updates and deleteStaleSessions for cleanup; updated existing queries |
| src/main/kotlin/gg/grounds/api/PlayerPresenceGrpcService.kt | Implemented heartbeat batch handler; enhanced login to detect and remove stale sessions |
| src/main/kotlin/gg/grounds/presence/PlayerSessionCleanup.kt | New scheduled task to automatically clean up stale sessions at configured intervals |
| src/main/resources/application.properties | Added session TTL and cleanup interval configuration; set global log level to DEBUG |
| src/test/resources/application.properties | Disabled scheduler in tests to prevent interference |
| src/test/kotlin/gg/grounds/api/PlayerPresenceGrpcServiceTest.kt | Added comprehensive tests for heartbeat batch and stale session handling |
| build.gradle.kts | Added scheduler dependency; updated to SNAPSHOT version of gRPC contracts library |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 13 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Please merge groundsgg/library-grpc-contracts#33 first. |
Pull Request
Description
Type of Change
Related Issues
None
Testing
Checklist