Skip to content

refactor: 팔로잉, 언팔로잉 되면 캐시 데이터 삭제#61

Merged
MODUGGAGI merged 1 commit intoreleasefrom
feat/58/sharedRefrigerator
Dec 15, 2025
Merged

refactor: 팔로잉, 언팔로잉 되면 캐시 데이터 삭제#61
MODUGGAGI merged 1 commit intoreleasefrom
feat/58/sharedRefrigerator

Conversation

@MODUGGAGI
Copy link
Contributor

@MODUGGAGI MODUGGAGI commented Dec 15, 2025

🚀 변경사항

🔗 관련 이슈

  • Closes #이슈번호

✅ 체크리스트

  • 로컬에서 테스트 완료
  • 코드 리뷰 준비 완료

📝 특이사항

Summary by CodeRabbit

  • Bug Fixes
    • Follow operations now return the followed member's data for improved response feedback and operation verification.
    • Unfollow operations now return the unfollowed member's ID for confirmation and tracking.
    • Enhanced consistency of member information following follow and unfollow actions.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 15, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The FollowCommandService methods now return values and include Spring Cache eviction annotations. The following method returns the created Member object, and the unfollowing method returns the followingId string, with both methods configured to evict cached memberInfo entries upon execution.

Changes

Cohort / File(s) Summary
Follow Service Caching & Return Types
src/main/java/novaminds/gradproj/domain/member/service/command/FollowCommandService.java
Added @Caching annotations with cache eviction to following() and unfollowing() methods. Updated method signatures: following returns Member (was void), unfollowing returns String (was void). Added return statements and cache eviction keys targeting memberInfo cache for follower and followed member login IDs.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify cache eviction keys correctly reference method parameters and return values
  • Confirm return types align with calling code expectations
  • Ensure @Caching annotations use correct cache name (memberInfo) and SpEL expressions

Poem

🐰 A follow becomes a gift, a return so true,
Cache evictions sweep old data through and through,
Members flow forward, their info refreshed anew,
Spring caches sing as the service shines through! ✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/58/sharedRefrigerator

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 670e5fe and 8f9ed39.

📒 Files selected for processing (1)
  • src/main/java/novaminds/gradproj/domain/member/service/command/FollowCommandService.java (4 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @MODUGGAGI, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 팔로우 및 언팔로우 기능이 실행될 때 관련 사용자 정보 캐시를 자동으로 무효화하여 데이터 일관성을 보장하기 위한 리팩토링입니다. 이를 통해 최신 팔로우 상태가 항상 사용자에게 반영되도록 합니다.

Highlights

  • 캐시 무효화 추가: 팔로우 및 언팔로우 작업 시 memberInfo 캐시 데이터를 자동으로 삭제하도록 @CacheEvict 어노테이션이 추가되었습니다.
  • 메서드 반환 타입 변경: following 메서드는 void에서 Member로, unfollowing 메서드는 void에서 String으로 반환 타입이 변경되어 캐시 키로 사용될 값을 반환합니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@MODUGGAGI MODUGGAGI merged commit b0e579b into release Dec 15, 2025
1 check was pending
@MODUGGAGI MODUGGAGI deleted the feat/58/sharedRefrigerator branch December 15, 2025 16:08
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

이번 PR은 팔로우 및 언팔로우 기능 실행 시 관련 사용자들의 캐시 데이터를 삭제하도록 리팩토링하는 내용을 담고 있습니다. Spring의 @CacheEvict 애노테이션을 사용하여 팔로우/언팔로우하는 사용자와 대상 사용자의 memberInfo 캐시를 무효화하도록 구현하셨습니다.

전반적인 로직은 올바르지만, 캐시 무효화를 위해 메서드 시그니처를 변경하는 대신 CacheManager를 직접 사용하여 프로그래밍 방식으로 캐시를 관리하는 방안을 제안합니다. 이 방법은 코드의 의도를 더 명확하게 하고 유지보수성을 높일 수 있습니다. 자세한 내용은 각 파일에 남긴 주석을 참고해주세요.

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