feat(duely): add admin list endpoints - #337
Conversation
SummarySummary
CoverageDuely.Application.Services - 88.3%
Duely.Application.UseCases - 93%
Duely.Domain.Models - 88.9%
Duely.Domain.Services - 91.8%
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5291939d65
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| { | ||
| var query = new GetUsersQuery | ||
| { | ||
| UserIds = webSocketConnectionManager.GetConnectedUserIds() |
There was a problem hiding this comment.
Make the active-user listing global across instances
When Duely runs more than one application instance, this returns only users connected to the instance serving the request because IWebSocketConnectionManager is a process-local singleton; users whose sockets terminate on another instance are omitted from /users/admin/active. The existing connection-lifecycle documentation explicitly states that no distributed presence exists, so this endpoint needs distributed aggregation or an explicitly local contract with corresponding process documentation and tests before it can reliably represent active users.
AGENTS.md reference: AGENTS.md:L39-L40
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Addressed in 7d1ceed. The active-user API is now explicitly process-local: the manager method is named GetLocallyConnectedUserIds, the current single-container production topology and multi-instance limitation are documented, and a test proves separate manager instances keep isolated presence snapshots. Verification: full Duely suite passed, 444/444 tests.
5291939 to
7d1ceed
Compare
SummarySummary
CoverageDuely.Application.Services - 88.3%
Duely.Application.UseCases - 92.3%
Duely.Domain.Models - 89%
Duely.Domain.Services - 93.1%
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7d1ceed961
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| .Select(submission => new SubmissionListItemDto | ||
| { | ||
| SubmissionId = submission.Id, | ||
| Status = submission.Status, | ||
| Language = submission.Language, |
There was a problem hiding this comment.
Include the duel identifier in global submission rows
When an administrator selects a row returned by either new global submissions endpoint, the response contains only the globally unique submission ID and no duel ID, while the only details route is GET /duels/{duelId}/submissions/{submissionId}. The existing DTO worked for the scoped list because the caller already supplied the duel and task, but these global results cannot be linked back to their duel through any returned data, so the client cannot open the newly enabled full submission view without guessing IDs; include at least duel_id (and preferably task_key for context) in this projection.
Useful? React with 👍 / 👎.
SummarySummary
CoverageDuely.Application.Services - 88.3%
Duely.Application.UseCases - 92.4%
Duely.Domain.Models - 89%
Duely.Domain.Services - 93.1%
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 56f9f0c2a5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| [JsonPropertyName("user_role"), JsonConverter(typeof(JsonStringEnumConverter))] | ||
| public required GroupRole UserRole { get; init; } | ||
| public GroupRole? UserRole { get; init; } |
There was a problem hiding this comment.
Remove the enum converter from the nullable role
Changing UserRole to GroupRole? makes the property-level JsonStringEnumConverter incompatible with its declared type because that converter factory accepts enum types, not Nullable<T> wrappers. ASP.NET will therefore throw while constructing serialization metadata for any GroupDto, causing group endpoints to return 500 even when the role is non-null; remove the property-level converter and let the globally registered enum converter handle the underlying enum, or provide a nullable-aware converter.
Useful? React with 👍 / 👎.
| .Include(duel => duel.Submissions) | ||
| .ThenInclude(submission => submission.User) |
There was a problem hiding this comment.
Stop loading submissions for the global duel list
When /duels/admin/finished is called after submission history has accumulated, this include materializes every submission—including its potentially large solution and diagnostic message—for every returned duel. DuelDtoMapper.Map never reads duel.Submissions, so these payloads are transferred from PostgreSQL and retained in memory without appearing in the response; remove this include chain to prevent the global history request from becoming increasingly expensive.
Useful? React with 👍 / 👎.
SummarySummary
CoverageDuely.Application.Services - 88.3%
Duely.Application.UseCases - 92.4%
Duely.Domain.Models - 89%
Duely.Domain.Services - 93.1%
|
Summary
OnlyAdminlist endpoints for users, duels, submissions, groups, and tournamentsduel_idandtask_keyin admin submission-list rows so the frontend can open the owning duel and selected taskGroupDto.user_roleisnullwhen an admin is not a memberAdmin list API
GET /users/admin/allGET /users/admin/activeGET /duels/admin/pendingGET /duels/admin/ranked-searchersGET /duels/admin/activeGET /duels/admin/finishedGET /duels/admin/submissions/testingGET /duels/admin/submissions/allGET /groups/admin/allGET /tournaments/admin/activeGET /tournaments/admin/finishedBoth admin submission endpoints return the regular submission-list fields plus
duel_idandtask_key.Additional admin read access
GET /duels/{duelId}GET /duels/{duelId}/submissions?taskKey={taskKey}GET /duels/{duelId}/submissions/{submissionId}GET /groups/{id}GET /groups/{id}/usersGET /groups/{id}/duelsGET /groups/{id}/tournamentsGET /tournaments/{id}Verification
masterateb6131edotnet test --configuration Release --no-restore --maxcpucount:1 --disable-build-servers— 445 tests passedCloses #331