Skip to content

fix: 내 피드 필터 설정 시 새로고침#810

Open
devfeijoa wants to merge 1 commit intorelease/1.6.0from
fix/809
Open

fix: 내 피드 필터 설정 시 새로고침#810
devfeijoa wants to merge 1 commit intorelease/1.6.0from
fix/809

Conversation

@devfeijoa
Copy link

@devfeijoa devfeijoa commented Feb 14, 2026

📌𝘐𝘴𝘴𝘶𝘦𝘴

📎𝘞𝘰𝘳𝘬 𝘋𝘦𝘴𝘤𝘳𝘪𝘱𝘵𝘪𝘰𝘯

  • 내 피드에서 필터/정렬 변경 시 동일 결과이면 빈 화면이 고정되는 문제 수정

📷𝘚𝘤𝘳𝘦𝘦𝘯𝘴𝘩𝘰𝘵

[수정 전]

Screen_recording_20260214_112215.mp4

[수정 후]

Screen_recording_20260214_112451.mp4

💬𝘛𝘰 𝘙𝘦𝘷𝘪𝘦𝘸𝘦𝘳𝘴

문제 상황

  1. 내 피드 탭 진입 후 피드 리스트가 정상 노출된 상태에서
  2. 필터를 변경했다가, 결과에 영향이 없는 필터를 다시 해제(또는 원복)했을 때
  3. 실제 데이터(피드 목록)는 동일한데도 UI가 Empty 화면으로 전환되고, 이후에도 리스트가 다시 표시되지 않음

요약: 필터 변경 결과가 “사실상 동일”한 케이스에서 빈 화면으로 고정되는 문제

원인 분석

1) ViewModel에서 필터/정렬 변경 시 UI 데이터를 선제적으로 초기화

기존 코드에서 필터/정렬 변경 시 아래처럼 myFeedData를 새 객체로 교체하여 feeds가 즉시 empty가 되었습니다.

  • applyMyFilter()에서 myFeedData = FeedSourceData()

  • updateMyFeedSort()에서 myFeedData = FeedSourceData(sort = sort)

이로 인해 필터/정렬 버튼을 누르는 순간 UI가 Empty 화면으로 전환될 수 있는 구조였습니다.

2) Repository(StateFlow)가 “동일 값”이면 emit하지 않아 UI 복구 트리거가 사라짐

Repository의 MutableStateFlow는 새로운 값이 이전 값과 equals로 동일하면 emit을 하지 않습니다.

실제 로그에서도 아래와 같이 changed=false(동일) 인 케이스가 발생했습니다.

  • changed=true: emit 발생 가능(데이터 변경)
  • changed=false: 데이터가 동일하여 emit이 발생하지 않음 → UI를 다시 채울 이벤트가 없음

current=2, next=2, changed=false

  • 이 경우 myFeedsFlow.collect { ... } 가 실행되지 않아 UI를 다시 채우는 로직이 동작하지 않았습니다.
  • 결과적으로 ViewModel이 미리 비워둔 myFeedData.feeds = [] 상태가 유지되어 Empty 화면에서 복구되지 않았습니다.

결론: “UI를 먼저 비움” + “동일 결과면 Flow emit 없음” 조합으로 Empty 화면 고정이 발생

해결방법

필터/정렬 변경 시 기존 리스트(feeds)를 비우지 않고 유지하며, 다음 요청을 위해 필요한 값만 리셋하도록 수정했습니다.

  • feeds는 유지 (Empty 전환 방지)
  • 페이지네이션을 위한 lastId=0, isLoadable=true만 초기화
  • isRefreshing=true로 UI에 갱신 중 상태만 표시
  • 서버/Repository에서 실제로 다른 데이터가 emit되면 기존처럼 collect에서 자연스럽게 교체됨

변경 사항 요약

  • applyMyFilter(): myFeedData = FeedSourceData()로 초기화하던 로직 제거 → feeds 유지 + refreshing 처리
  • updateMyFeedSort(): 동일하게 feeds 유지 + paging reset + refreshing 처리
  • 페이징을 위해 lastId=0, isLoadable=true만 리셋하여 재조회는 수행하되, 결과가 동일하여 emit이 없더라도 UI가 빈 화면으로 전환되지 않도록 수정
  • 결과적으로 동일 데이터로 인해 emit이 발생하지 않는 상황에서도 UI가 Empty로 고정되지 않음

비고(동기화 전략과의 관계)

본 이슈는 "dirty를 언제 서버에 반영할지(동기화 타이밍)"의 문제가 아니라,
UI 상태를 선제적으로 비운 뒤, 동일 결과에서는 Flow emit이 없어 복구되지 않는 UI 상태 관리 문제였습니다!
따라서 데이터가 동일해 emit이 없더라도 UI가 안정적으로 유지되도록 UI 상태 관리를 개선하였습니다.

@devfeijoa devfeijoa requested review from m6z1 and s9hn February 14, 2026 03:01
@devfeijoa devfeijoa self-assigned this Feb 14, 2026
@devfeijoa devfeijoa added 🔨 [FIX] 버그를 수정합니다. [👸 공주 은영] labels Feb 14, 2026
@coderabbitai
Copy link

coderabbitai bot commented Feb 14, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/809

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


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.

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.

1 participant