Skip to content

[FIX] 게시물 북마크 버그 수정 - #265

Open
ryusuye0n wants to merge 4 commits into
developfrom
feature/#264-bookmark-bug-fix
Open

[FIX] 게시물 북마크 버그 수정#265
ryusuye0n wants to merge 4 commits into
developfrom
feature/#264-bookmark-bug-fix

Conversation

@ryusuye0n

Copy link
Copy Markdown
Contributor

📌 개요

게시물 북마크 기능 버그를 수정하도록 하겠습니다.


🎯 작업 목표

  • 게시물 북마크 기능 정상작동 시키기

🧩 작업 내용

  • 게시물 북마크 버그 수정

✅ 완료 조건

  • 게시물 북마크 기능이 정상적으로 작동된다
  • 게시물 상세보기 하트 상태와 미리보기 북마크 상태가 통일되어있다

📎 참고 사항

  • 디자인 시안 (figma)
  • api 명세서

closes #264

- 좋아요(하트)와 동일한 패턴으로 북마크 기능 전체 배선
- 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>
@ryusuye0n ryusuye0n self-assigned this Jun 22, 2026
@ryusuye0n ryusuye0n added the fix 버그 수정 label Jun 22, 2026

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread lib/presentation/community/controllers/community_controller.dart
Comment thread lib/presentation/post/controllers/post_view_controller.dart Outdated
@ryusuye0n ryusuye0n changed the title [FIX] 게시물 북마크 버그 수 [FIX] 게시물 북마크 버그 수정 Jun 23, 2026
# 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
@ryusuye0n
ryusuye0n force-pushed the feature/#264-bookmark-bug-fix branch from d120ffc to 2bdcb05 Compare June 23, 2026 04:53

@eum018 eum018 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

추가적으로, 실제 UI 테스트를 했을 때 북마크가 제대로 동기화 되지 않는 것을 확인해서
아직 버그가 남아 있는 것 같습니다.

await _savePostBookmarkLocalUseCase(postId, isBookmarked);
} catch (e) {
debugPrint('[CommunityController] 북마크 토글 실패 - error: $e');
_updatePostBookmarkInList(postId, isBookmarked ? -1 : 1, !isBookmarked);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

굳이 빼는 값을 함수의 인자로 넘기는 것 보다는,
해당 로직을 함수 내에 정의하는 구조가 더 나을 듯 합니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix 버그 수정

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FIX] 게시물 북마크 버그 수정

2 participants