Skip to content

[BUG] 토스트 메세지 관련 오류 수정#253

Merged
jeonbinggu merged 3 commits intodevelopfrom
bug/photo-feed-toast-message(#242)
Feb 12, 2026
Merged

[BUG] 토스트 메세지 관련 오류 수정#253
jeonbinggu merged 3 commits intodevelopfrom
bug/photo-feed-toast-message(#242)

Conversation

@dodaaaaam
Copy link
Contributor

@dodaaaaam dodaaaaam commented Feb 12, 2026

🔀 Pull Request Title

토스트 메세지 관련 버그 수정

📌 PR 설명

이번 PR에서 어떤 작업을 했는지 요약해주세요.

  • 토스트 메세지 띄운 뒤 state 초기화
  • 사진수다 조회 캐싱 시간 수정

📷 스크린샷

UI 변경이 있을 경우 스크린샷을 첨부해주세요.


@dodaaaaam dodaaaaam linked an issue Feb 12, 2026 that may be closed by this pull request
3 tasks
@vercel
Copy link

vercel bot commented Feb 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
finders Ready Ready Preview, Comment Feb 12, 2026 1:46pm

@dodaaaaam dodaaaaam self-assigned this Feb 12, 2026
@dodaaaaam dodaaaaam requested review from MlNTYS, hyunseo-han and jeonbinggu and removed request for jeonbinggu February 12, 2026 13:07
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @dodaaaaam, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 토스트 메시지 표시와 관련된 버그를 수정하고, 사진 피드 데이터의 캐싱 전략을 개선합니다. 토스트 메시지가 사라진 후 관련 상태를 명확하게 초기화하여 사용자 경험을 향상시키고, 데이터 캐싱 시간을 조정하여 최신 정보를 더 빠르게 반영하도록 합니다.

Highlights

  • 토스트 메시지 상태 초기화: 토스트 메시지가 사라진 후 관련 상태(예: isNewPost, 삭제 여부)를 초기화하여, 페이지 이동 시 불필요한 메시지가 다시 표시되지 않도록 수정되었습니다.
  • 캐싱 시간 단축: useInfinitePosts 훅에서 staleTime을 5분에서 1분으로, gcTime을 30분에서 5분으로 단축하여 데이터 신선도를 높였습니다.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • src/hooks/photoFeed/posts/useInfinitePosts.ts
    • staleTimegcTime을 단축하여 캐시 유지 시간을 줄였습니다.
  • src/pages/photoFeed/PhotoFeedPage.tsx
    • 토스트 메시지 타이머 완료 시 navigate를 사용하여 현재 경로를 대체하고 관련 상태를 초기화하도록 변경했습니다.
  • src/pages/photoFeed/PostPage.tsx
    • 토스트 메시지 타이머 완료 시 isNewPost 상태를 false로 초기화하도록 추가했습니다.
Activity
  • 현재까지 특별한 리뷰 활동이나 코멘트는 없습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@dodaaaaam dodaaaaam added the bug 버그 수정 label Feb 12, 2026
Copy link
Contributor

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

Choose a reason for hiding this comment

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

Code Review

이번 PR은 토스트 메시지 표시 후 상태를 초기화하는 버그 수정과 사진수다 피드의 캐시 시간을 조정한 내용을 담고 있습니다. 전반적으로 의도한 대로 잘 수정되었으나, 몇 가지 개선점을 제안합니다. useEffect의 의존성 배열을 관리하고, 여러 곳에서 사용되는 매직 넘버들을 상수로 추출하여 코드의 가독성과 유지보수성을 높이는 것을 고려해보세요. 자세한 내용은 각 파일에 남긴 코멘트를 참고해주세요.

Comment on lines +20 to +21
staleTime: 1000 * 60, // 1분 동안은 "신선" → 마운트돼도 refetch 안 함
gcTime: 1000 * 60 * 5, // 5분간 캐시 유지
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

가독성을 위해 시간 값을 상수로 정의하는 것이 좋습니다. 예를 들어, const MINUTE_IN_MS = 60 * 1000; 와 같이 상수를 정의하고 staleTime: MINUTE_IN_MS, gcTime: 5 * MINUTE_IN_MS 처럼 사용하면 코드를 이해하기 더 쉬워집니다. 이 파일 내에서 지역 상수로 정의하거나, 여러 곳에서 사용된다면 공통 constants 파일로 분리하는 것을 고려해 보세요.

Comment on lines 44 to 48
const fadeTimer = setTimeout(() => setToastVisible(false), 1600);
const removeTimer = setTimeout(() => setMounted(false), 3000);
const removeTimer = setTimeout(() => {
setMounted(false);
navigate(location.pathname, { replace: true }); // 타이머 없앨 때 state도 같이 삭제
}, 3000);
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

가독성과 유지보수성을 위해 16003000 같은 매직 넘버 대신 의미 있는 이름의 상수를 사용하는 것을 고려해보세요. 예를 들어, TOAST_FADE_START_DELAYTOAST_UNMOUNT_DELAY 같은 상수로 정의하면 코드의 의도를 더 명확하게 파악할 수 있습니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

반영

Comment on lines 66 to 70
const fadeTimer = setTimeout(() => setToastVisible(false), 1600);
const removeTimer = setTimeout(() => setMounted(false), 3000);
const removeTimer = setTimeout(() => {
setIsNewPost(false);
setMounted(false);
}, 3000);
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

가독성과 유지보수성을 위해 16003000 같은 매직 넘버 대신 의미 있는 이름의 상수를 사용하는 것을 고려해보세요. 이 값들은 PhotoFeedPage.tsx에서도 동일하게 사용되므로, 공통 상수로 추출하여 재사용하면 일관성을 유지하고 관리하기 용이해집니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

반영

gcTime: 1000 * 60 * 5, // 5분간 캐시 유지
refetchOnMount: false, // 컴포넌트 마운트 시 재요청 막기
refetchOnWindowFocus: false, // 탭 다시 클릭/포커스 시 재요청 막기
refetchOnReconnect: false, // 네트워크 재연결 시 재요청 막기
Copy link
Contributor

Choose a reason for hiding this comment

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

SHOULD: 이제 봤지만 refetchOnReconnect 정도는 살려둬도 괜찮을거 같아요!

Copy link
Contributor

@MlNTYS MlNTYS left a comment

Choose a reason for hiding this comment

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

PRAISE: 캐시 로직이랑 스크롤 Toast 잘 해주셨는데 Toast 로직이 반복되는 거 같아서 분리해도 좋을 거 같네요!

@MlNTYS MlNTYS changed the title 토스트 메세지 관련 버그 수정 [BUG] 토스트 메세지 관련 버그 수정 Feb 12, 2026
@MlNTYS MlNTYS changed the title [BUG] 토스트 메세지 관련 버그 수정 [BUG] 토스트 메세지 관련 오류 수정 Feb 12, 2026
Copy link
Contributor

@hyunseo-han hyunseo-han left a comment

Choose a reason for hiding this comment

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

어푸 드립니다~!

@jeonbinggu jeonbinggu merged commit 4ff6bce into develop Feb 12, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug 버그 수정

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] 토스트 메세지 관련 오류 수정

4 participants