Skip to content

Follow-up: add hasNext to ScrollResponse and validate in scroll service tests#308

Merged
IjjS merged 1 commit intomainfrom
codex/github-mention-fix-scroll-response-hasnext
Mar 13, 2026
Merged

Follow-up: add hasNext to ScrollResponse and validate in scroll service tests#308
IjjS merged 1 commit intomainfrom
codex/github-mention-fix-scroll-response-hasnext

Conversation

@IjjS
Copy link
Member

@IjjS IjjS commented Mar 13, 2026

Motivation

  • Clients could not reliably detect last-page responses from cursor pagination because ScrollResponse lacked an explicit hasNext flag, causing duplicate/infinite fetches in some flows.
  • The change centralizes the next-page semantics in the shared DTO so all services using ScrollResponse behave consistently.

Description

  • Added boolean hasNext to the ScrollResponse record and set it in from(List<T>, String) as nextCursor != null to derive next-page semantics from existing cursor logic.
  • Updated service tests that produce/consume ScrollResponse to assert hasNext semantics in paging scenarios for both pageable and last-page cases.
  • Test files updated: DduduSearchServiceTest, AnnouncementSearchServiceTest, and NotificationInboxSearchServiceTest to include hasNext=true for pageable paths and hasNext=false for last-page/single-result cases.
  • Kept nextCursor behavior unchanged and computed hasNext from it, minimizing changes to service implementation logic.

Testing

  • Ran compile checks: ./gradlew :application:application-common:compileJava :application:notification-application:compileTestJava :application:planning-application:compileTestJava which completed successfully.
  • Attempted targeted test execution with ./gradlew :application:planning-application:test --tests "*DduduSearchServiceTest" :application:notification-application:test --tests "*AnnouncementSearchServiceTest" --tests "*NotificationInboxSearchServiceTest" which ultimately failed in this environment due to test environment datasource/Bean creation issues and JaCoCo coverage verification failures.
  • Verified that test source compilation for the affected modules succeeded with ./gradlew :application:notification-application:compileTestJava :application:planning-application:compileTestJava.

Codex Task

@IjjS IjjS self-assigned this Mar 13, 2026
@IjjS IjjS added the 🚨bugfix Something isn't working label Mar 13, 2026
@IjjS IjjS linked an issue Mar 13, 2026 that may be closed by this pull request
6 tasks
@github-actions
Copy link

📊 Jacoco Test Coverage

Overall Project 94.54% 🍏
Files changed 100% 🍏

File Coverage
ScrollResponse.java 100% 🍏

void 마지막_페이지면_nextCursor는_null이고_hasNext는_false다() {
// given
int totalSize = size + 1;
NotificationInboxSearchRequest request = new NotificationInboxSearchRequest("0", totalSize + 10);

Choose a reason for hiding this comment

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

⚠️ [checkstyle] <com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck> reported by reviewdog 🐶
Line is longer than 100 characters (found 101).

NotificationInboxSearchRequest request = new NotificationInboxSearchRequest("0", totalSize + 10);

// when
ScrollResponse<NotificationInboxSearchResponse> response = notificationInboxSearchService.search(

Choose a reason for hiding this comment

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

⚠️ [checkstyle] <com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck> reported by reviewdog 🐶
Line is longer than 100 characters (found 101).

@IjjS
Copy link
Member Author

IjjS commented Mar 13, 2026

@codex 현재 PR에 github-actions bot이 남겨둔 checkstyle warning을 수정해봐

@chatgpt-codex-connector
Copy link

Summary

Testing

  • awk 'length($0)>100 {print NR ":" length($0)}' application/notification-application/src/test/java/com/ddudu/application/notification/inbox/NotificationInboxSearchServiceTest.java (no output; no lines exceed 100 chars)
  • ⚠️ bash ./gradlew --no-daemon :application:notification-application:checkstyleTest --stacktrace (build started but did not finish within session time window)
  • ⚠️ curl -I https://checkstyle.sourceforge.io/checks/sizes/linelength.html | head (web lookup attempt blocked by proxy 403)

View task →

@IjjS IjjS marked this pull request as ready for review March 13, 2026 04:24
@IjjS IjjS merged commit bd1958a into main Mar 13, 2026
2 of 3 checks passed
@IjjS IjjS deleted the codex/github-mention-fix-scroll-response-hasnext branch March 13, 2026 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🚨bugfix Something isn't working codex

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix: scroll response에 hasNext 추가

1 participant