-
Notifications
You must be signed in to change notification settings - Fork 1
[BE-Fix] 롱 폴링이 제대로 작동하지 않는 버그 수정 #410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- 사용자가 새로 고침을 하게 될 경우 기존의 연결을 끊고 새로운 연결을 생성한다. - 이때 setResult()를 통해 대체되었다는 응답을 하게 된다. - setResult()가 실행되면 onCompletion()의 메소드가 실행되고 - 바로 map에 존재하던 연결을 지우게 된다. - 결과적으로 새로고침 한 번으로 지우고 만들고 지우는 처리가 진행된다. - 이를 해결하기 위해 onCompletion()에서 현재 연결 중인 DeferredResult가 유효한지 체크하여 유효하지 않은 경우에만 지우도록 변경하였다.
WalkthroughThe logic for removing user IDs from the results map in the DeferredResultManager has been updated. Now, the removal on deferred result completion is conditional: it checks if the user ID exists and if its DeferredResult is set or expired before removing. The onTimeout handler's behavior remains unchanged. Changes
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Join our Discord community for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
backend/src/main/java/endolphin/backend/global/util/DeferredResultManager.java
Outdated
Show resolved
Hide resolved
efdao
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
#️⃣ 연관된 이슈>
📝 작업 내용> 이번 PR에서 작업한 내용을 간략히 설명해주세요(이미지 첨부 가능)
사용자가 새로 고침을 하게 될 경우 기존의 연결을 끊고 새로운 연결을 생성한다.
이때 setResult()를 통해 대체되었다는 응답을 하게 된다.
setResult()가 실행되면 onCompletion()의 메소드가 실행되고
바로 map에 존재하던 연결을 지우게 된다.
결과적으로 새로고침 한 번으로 지우고 만들고 지우는 처리가 진행된다.
이를 해결하기 위해 onCompletion()에서 현재 연결 중인 DeferredResult가 유효한지 체크하여 유효하지 않은 경우에만 지우도록 변경하였다.
🙏 여기는 꼭 봐주세요! > 리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요
Summary by CodeRabbit