Skip to content

[codex] Fix notification async dispatch#331

Merged
jjoonleo merged 1 commit into
devfrom
feature/fix-notification-async-dispatch
Jun 30, 2026
Merged

[codex] Fix notification async dispatch#331
jjoonleo merged 1 commit into
devfrom
feature/fix-notification-async-dispatch

Conversation

@jjoonleo

Copy link
Copy Markdown
Contributor

Summary

  • Split notification scheduling from notification delivery so scheduled tasks capture only notificationId.
  • Add a proxied NotificationDispatchService with @Async("notificationAsyncExecutor") and @Transactional to reload notifications before delivery.
  • Move delivery logic into NotificationDeliveryService and add regression tests, including a numeric async-boundary test.

Why

The previous scheduled lambda called sendReminder(...) inside NotificationService, so Spring proxy advice did not apply to @Async or @Transactional. The scheduler thread could therefore run delivery work directly, and the service-level transaction boundary was unclear.

Validation

  • ./gradlew test
  • ./gradlew check
  • git diff --check

The async integration test blocks delivery for 300ms and verifies dispatch returns in under 100ms while delivery runs on a notification-* thread with an active transaction.

@jjoonleo jjoonleo marked this pull request as ready for review June 30, 2026 10:43
@jjoonleo jjoonleo force-pushed the feature/fix-notification-async-dispatch branch from ebe7d17 to 6966b18 Compare June 30, 2026 10:47
@jjoonleo jjoonleo merged commit b7fc532 into dev Jun 30, 2026
1 check 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.

1 participant