[FIX] 게시물 북마크 버그 수정 - #265
Conversation
- 좋아요(하트)와 동일한 패턴으로 북마크 기능 전체 배선 - PostLocalDatasource에 북마크 상태 로컬 캐시(saveBookmarkState/bookmarkedPost) 추가 - BookmarkedPostUseCase, SavePostBookmarkLocalUseCase, BookmarkChangedEvent 신규 - PostViewController: 진입 시 로컬 캐시로 북마크 상태 복원 및 목록 동기화 - Home/CommunityController: 목록 로드 시 isBookmark 복원, lastBookmarkEvent 구독, toggleBookmark 추가 - home_screen 빈 콜백 연결 및 community_post_list bookmarkAction 추가 - PostEntity.copyWith가 isBookmark/bookmarkCount를 보존하도록 수정(좋아요 토글 시 북마크 표시 사라지던 문제 해결) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request implements bookmarking functionality across the application, adding local caching via SharedPreferences, updating bindings, and integrating bookmark toggle and sync logic within the controllers and UI. The feedback highlights two critical issues: first, in CommunityController, syncing bookmarks via assignAll can inadvertently clear active tag filters on the post list; second, in PostViewController, syncing should only occur if the post details are successfully fetched to prevent resetting bookmark and like counts to zero upon API failure.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
# Conflicts: # lib/core/router/bindings/community_binding.dart # lib/core/router/bindings/post_binding.dart # lib/domain/entities/post/post_entity.dart # lib/presentation/community/controllers/community_controller.dart # lib/presentation/home/controllers/home_controller.dart # lib/presentation/home/screens/home_screen.dart # lib/presentation/post/controllers/post_controller.dart
d120ffc to
2bdcb05
Compare
eum018
left a comment
There was a problem hiding this comment.
추가적으로, 실제 UI 테스트를 했을 때 북마크가 제대로 동기화 되지 않는 것을 확인해서
아직 버그가 남아 있는 것 같습니다.
| await _savePostBookmarkLocalUseCase(postId, isBookmarked); | ||
| } catch (e) { | ||
| debugPrint('[CommunityController] 북마크 토글 실패 - error: $e'); | ||
| _updatePostBookmarkInList(postId, isBookmarked ? -1 : 1, !isBookmarked); |
There was a problem hiding this comment.
굳이 빼는 값을 함수의 인자로 넘기는 것 보다는,
해당 로직을 함수 내에 정의하는 구조가 더 나을 듯 합니다.
📌 개요
게시물 북마크 기능 버그를 수정하도록 하겠습니다.
🎯 작업 목표
🧩 작업 내용
✅ 완료 조건
📎 참고 사항
closes #264