Skip to content

feat: api 호출 실패 시 화면 처리 #354

Merged
jihun32 merged 17 commits into
developfrom
feat/#351/TWI-129
Jun 15, 2026
Merged

feat: api 호출 실패 시 화면 처리 #354
jihun32 merged 17 commits into
developfrom
feat/#351/TWI-129

Conversation

@jihun32

@jihun32 jihun32 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

🔗 관련 이슈

📙 작업 내역

  • 디자인시스템에 DataRetryView, modifier 구현
  • 수정 필요한 Feature View, Reducer 적용
  • 기존 date fetch 실패 토스트 제거

🎨 스크린샷 또는 시연 영상 (선택)

테스트용 화면
image

@linear-code

linear-code Bot commented Jun 8, 2026

Copy link
Copy Markdown

TWI-129

@clxxrlove

Copy link
Copy Markdown
Member

@coderabbitai summary

@github-actions github-actions Bot requested a review from clxxrlove June 8, 2026 12:54
@github-actions github-actions Bot added D-2 and removed D-3 labels Jun 9, 2026

@clxxrlove clxxrlove left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

수고했어~~!!

Comment on lines -344 to +352
case .response(.fetchGoalsFailed):
case let .response(.fetchGoalsFailed(date)):
guard date == state.calendarDate else { return .none }
state.isLoading = false
return .send(.presentation(.showToast(.warning(message: "목표 조회에 실패했어요"))))
state.isFetchFailed = true
return .none

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

여기는 조금 어려운데, 캐시 데이터가 있는 경우에도 refresh가 실패하면 state.isFetchFailed가 true가 되어서
로딩 인디케이터가 화면을 꽉 덮을 거 같은데 어떻게 해결해야 할 지 잘 모르겠네... 토스트를 띄우면 되려나?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

그러게 지금 txDataRetry 구조가 overlay로 띄우는거라 캐시된 데이터랑 재시도뷰가 겹처 보이네
그래서 overlay로 덮는 구조로 안하고 재시도가 필요한 상황일 때 기존 콘텐츠가 아닌 DataRetryView 보여주면 안겹치게 할 수 있을 거 같은데 어떻게 생각해?

as-is

.txDataRetry(
    isPresented: store.isFetchFailed,
    onRetry: { store.send(.view(.dataRetryTapped)) }
)
5668E0FB-FA44-4D2F-B3FD-FD446F5961B9_1_102_o

to-be

if store.isFetchFailed {
    DataRetryView {
        store.send(.view(.dataRetryTapped))
    }
} else if store.hasCards {
    HomeContentSection(store: store)
} else if store.isEmptyVisible {
    HomeEmptyContentSection(store: store)
}
BD2452A3-357F-4318-8B21-3F58ED0EB21E_1_102_o

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

맞아 overlay로 하면 화면이 겹쳐서 어색할 거 같다
to-be 방향으로 필요에 따라 DataRetryView를 보여주는 게 더 좋은 거 같아 !!
반영하고 머지하자 !!

Comment on lines +131 to +135
case let .response(.fetchStatsFailed(month, isOngoing)):
guard month == state.currentMonth.formattedYearDashMonth,
isOngoing == state.isOngoing else {
return .none
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

여기 실패 케이스에서 isOngoing 받는 부분은 좋은데,
성공 부분은 제대로 안 맞추고 있는거 같아. 거기에서도 `case fetchStats(..., isOngoing: Bool)로 맞추는게 어때?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

반영할게~

@github-actions github-actions Bot added D-1 and removed D-2 labels Jun 10, 2026
@jihun32 jihun32 merged commit fc81f24 into develop Jun 15, 2026
1 check passed
@jihun32 jihun32 deleted the feat/#351/TWI-129 branch June 15, 2026 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants