Skip to content

v2.2.0 rc.1#18

Merged
byteful merged 2 commits intomainfrom
dev
Apr 19, 2026
Merged

v2.2.0 rc.1#18
byteful merged 2 commits intomainfrom
dev

Conversation

@byteful
Copy link
Copy Markdown
Member

@byteful byteful commented Apr 19, 2026

cool shi

@TheoBong TheoBong self-requested a review April 19, 2026 07:00
Copy link
Copy Markdown
Member

@TheoBong TheoBong left a comment

Choose a reason for hiding this comment

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

lgtm

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 19, 2026

Greptile Summary

This PR makes two targeted service-layer fixes: it replaces generic IllegalArgumentException with a domain-specific ValidationException in ReplayService.initUpload, and it adds a null-guard on ticket.getType() in TicketService to prevent an NPE when a ticket has no type assigned. New unit tests cover both ValidationException paths in initUpload.

Confidence Score: 5/5

Safe to merge — all findings are P2 style suggestions with no blocking issues.

Changes are small, well-tested, and strictly improvements: a domain exception swap and a null-guard. No logic regressions or data-integrity concerns were found.

No files require special attention.

Important Files Changed

Filename Overview
src/main/java/gg/modl/backend/replay/service/ReplayService.java Swaps generic IllegalArgumentException for domain-specific ValidationException in initUpload; logic is unchanged and correct.
src/main/java/gg/modl/backend/ticket/service/TicketService.java Adds a null-guard around ticket.getType() before accessing its ID, preventing an NPE when a ticket has no type set.
src/test/java/gg/modl/backend/replay/service/ReplayServiceTest.java New unit tests covering both ValidationException paths in initUpload; stubs, assertions, and interaction verification are all correct.

Sequence Diagram

sequenceDiagram
    participant Client
    participant ReplayService
    participant StorageQuotaService
    participant S3StorageService
    participant ReplayMongoRepository

    Client->>ReplayService: initUpload(server, mcVersion, fileSize)
    alt fileSize > maxFileSize
        ReplayService-->>Client: throws ValidationException("File size exceeds maximum of N MB")
    else quota exceeded
        ReplayService->>StorageQuotaService: canUpload(server, fileSize)
        StorageQuotaService-->>ReplayService: false
        ReplayService-->>Client: throws ValidationException("Storage quota exceeded")
    else valid
        ReplayService->>StorageQuotaService: canUpload(server, fileSize)
        StorageQuotaService-->>ReplayService: true
        ReplayService->>S3StorageService: createPresignedUploadUrl(...)
        S3StorageService-->>ReplayService: PresignUploadResponse
        ReplayService->>ReplayMongoRepository: saveEntity(server, doc)
        ReplayService-->>Client: InitReplayUploadResponse
    end
Loading

Comments Outside Diff (1)

  1. src/main/java/gg/modl/backend/replay/service/ReplayService.java, line 44-75 (link)

    P2 Missing Javadoc on public service methods

    Per the project's standards, all public service methods must have meaningful Javadoc. initUpload (and the other public methods in this file) are undocumented. Since this PR touches initUpload directly, it's a good opportunity to add a doc comment covering the parameters, return value, and the two validation conditions that throw ValidationException.

    Rule Used: This is a Java Spring Boot REST API backed by Mong... (source)

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

    Fix in Claude Code

Fix All in Claude Code

Reviews (1): Last reviewed commit: "fix 109" | Re-trigger Greptile

@byteful byteful merged commit b065ba0 into main Apr 19, 2026
3 checks passed
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.

2 participants