Skip to content

[FEATURE] 비동기, 에러 처리 로직 추가 - #263

Merged
eum018 merged 17 commits into
developfrom
feature/#262-async-error-handling
Jun 22, 2026
Merged

[FEATURE] 비동기, 에러 처리 로직 추가#263
eum018 merged 17 commits into
developfrom
feature/#262-async-error-handling

Conversation

@eum018

@eum018 eum018 commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

📌 개요

앱 내, 전체 화면을 범위로 비동기, 에러 처리 로직을 추가하는 것을 목적으로 합니다.


🧩 작업 내용

  • 리스트 로직 Pageable, Listable 적용
  • 서버 api와 통신 중에 있을 시 AppIndigator 표시
  • 서버 통신 중 에러 감지 시, AppSnackbar로 오류 표시

eum018 and others added 5 commits June 22, 2026 03:14
- comment, rating, user(추천/검색) usecase/repo/datasource 전 레이어에 ListableWrapper 페이지네이션 적용
- HomeController: 추천 유저 page 기반 무한 스크롤 (_fetchRecommendUsers, loadMoreUsers)
- PostViewController: 댓글 page 기반 로드 (loadMoreComments, _refetchAllComments) 및 댓글 추가 후 마지막 페이지 자동 이동 (scrollToLastCommentTrigger)
- 홈 실시간 인기 게시물 인디케이터: 동적 dot 수, 1페이지 이하 미표시
- 검색 re-submit 버그 수정: submitCount로 Obx 강제 재평가
- resultPageBuilder build phase 중 상태 변경 버그 수정: addPostFrameCallback 적용
- 태그/추천어 클릭 시 검색 필드 텍스트 채움 (submitFromSuggestion)
- 검색 로컬 태그 로드 주기 최적화: submit 후 1회만 재조회 (_lastLoadedAtSubmitCount)
- ProfileController(my/other/setting): ListableWrapper 반환형 맞게 수정
- ChatMainController: 페이지네이션 구조 맞게 수정
- other_profile_screen: Expanded 괄호 불일치 컴파일 오류 수정

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- 공유 컴포넌트 추가: AppLoadingIndicator, AppBottomLoadingIndicator, AppEmptyState, AppErrorState
- AppEmptyState: AppIcon(SVG/PNG) 기반 아이콘 렌더링으로 디자인 시스템 통일
- 홈: 실시간 인기 게시물, 추천 게시물, 추천 유저 로딩/에러/빈 상태 적용
- 커뮤니티: 게시물 목록 및 검색 결과 로딩/에러/빈 상태 적용
- 채팅: 초기 로딩(isLoading) 추가 및 목록 로딩/에러/빈 상태 적용
- 게시물 상세: 댓글 로딩/빈 상태 적용
- 검색 결과(홈/커뮤니티): 게시물·유저 각각 빈 상태 적용
- 프로필: 작성 게시물·즐겨찾기·다른 유저 게시물 빈 상태 메시지 적용
- 화면 맥락에 맞는 빈 상태 메시지 작성 (단순 "없어요" 대신 사용자 행동 유도 문구)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- PostController에 lastDeleteEvent, lastUpdateEvent 추가 (이벤트 버스 패턴)
- PostViewController.deletePost()에서 notifyPostDeleted() 호출
- CommunityPostCreateController._updatePost()에서 notifyPostUpdated() 호출
- HomeController, CommunityController에 ever() 리스너 추가 → 삭제/수정 자동 반영
- PostViewController.onInit()에 ever(lastUpdateEvent) 추가 → 상세 화면 자동 갱신
- PostDetail, MyProfile, OtherProfile 화면에 전체 화면 로딩 인디케이터 적용
- CreatePostUseCase, UpdatePostUseCase를 PostBinding(전역)으로 이동
- PostViewBinding에서 중복 등록 제거
- PostEntity.copyWith()에 title, tags 필드 추가

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- HomeController/CommunityController.toggleLike(): savePostLikeLocalUseCase를
  API 호출 전으로 이동 (낙관적 저장)
  → 목록에서 좋아요 후 즉시 PostDetail 진입 시 _initIsFavorite()가 최신 상태를 읽도록 수정
  → API 실패 시 로컬 캐시도 함께 롤백
- PostEntity.copyWith(): isBookmark, bookmarkCount 필드 누락 수정
  (기존: copyWith 호출 시마다 isBookmark가 false로 초기화)
- CommunityController._syncLike(): viewPostList.assignAll() → in-place 업데이트
  (태그 필터 상태 유지)
- CommunityController._updatePostLikeInList(): 이중 Obx 트리거(refresh()) 제거,
  캐시 우선 업데이트 방식으로 정리
- HomeController._syncLike(): 동일하게 in-place 업데이트 방식으로 통일

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@eum018
eum018 requested review from heoeunseo08 and ryusuye0n June 21, 2026 23:36
@eum018 eum018 self-assigned this Jun 21, 2026
@eum018 eum018 linked an issue Jun 21, 2026 that may be closed by this pull request
3 tasks

@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 introduces robust pagination, infinite scrolling, and unified error/loading states across various screens, including Home, Community, Chat, and Profile. It also implements event-driven synchronization for post updates and deletions. During the review, several issues were identified: a critical bug in OtherProfileController where userPublicId is not saved, breaking pagination; a bug in CommunityController where updating a post resets the filtered view list; potential performance issues in PostViewController due to sequential comment refetching; and multiple instances where NotificationListener needs to be restricted to notification.depth == 0 to prevent horizontal child scrolls from triggering vertical pagination.

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/profile/controllers/other_profile_controller.dart
Comment thread lib/presentation/community/controllers/community_controller.dart
Comment thread lib/presentation/post/controllers/post_view_controller.dart
Comment thread lib/presentation/home/screens/home_screen.dart
Comment thread lib/presentation/profile/screens/my_profile_screen.dart
Comment thread lib/presentation/profile/screens/other_profile_screen.dart
Comment thread lib/presentation/home/screens/home_search_screen.dart Outdated
@eum018

eum018 commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

이번 pr은 프로젝트 전체적으로

  1. 비동기 UI처리랑,
  2. 사용자에게 error 표시 (snackbar)
  3. api에서 넘겨주는 리스트 관련 값을 활용하여, 리스트 스크롤 시 로딩 로직 추가
    를 한 pr이기 때문에, 여러 파일에 비슷한 로직이 추가된 변경이 많습니다.
    전체를 꼼꼼히 확인하는 것보다는 구현한 기능 하나를 보고 방향성을 파악하는 게 좋을 것 같습니다.

@heoeunseo08 heoeunseo08 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.

수고하셨습니다.

eum018 and others added 7 commits June 22, 2026 14:11
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@ryusuye0n ryusuye0n 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.

수고하셨습니다

- post/user search datasource null 반환 → rethrow 패턴으로 통일
- HomeSearchResultController errorMessage 추가, search 실패 시 에러 반영
- CommunityController API 검색 연동 (로컬 필터 제거), 페이지네이션 추가
- 홈/커뮤니티 검색 결과 화면: 데이터 없을 때 섹션별 Expanded로 아이콘 중앙 정렬

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@eum018
eum018 merged commit 3a15feb into develop Jun 22, 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.

[FEATURE] 비동기, 에러 처리 로직 추가

3 participants