-
Notifications
You must be signed in to change notification settings - Fork 3
[release] FE v1.1.18 #1070
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
Merged
Merged
[release] FE v1.1.18 #1070
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
d043f4d
refactor: Award 타입 구조화 및 중복 타입 정의 제거
seongwon030 c340e4a
refactor: Award 타입 구조화 및 중복 타입 정의 제거
seongwon030 1483360
Merge branch 'develop-fe' into refactor/#1050-year-semester-type-MOA-523
seongwon030 35445e0
fix: Award key에 index 추가하여 고유성 보장
seongwon030 522cf20
feat: eventsource 라이브러리 도입
lepitaaar 8be9ff7
feat: sse 이벤트 타입 정의
lepitaaar 06ec81a
feat: sse 연결 함수 추가
lepitaaar ae08944
feat: AdminClubContext내 sse연결 핸들링
lepitaaar e8f1680
feat: sse type 추가
lepitaaar ef83820
feat: sse연결 관리 및 지원자 정보 업데이트
lepitaaar 904012f
fix: wrong import path
lepitaaar cbc65c0
refactor: sse 연결 시마다 새로운 accesstoken 읽게 변경
lepitaaar 3fc96e2
refactor: error 재연결 로직 변경
lepitaaar 77ba5f8
Merge pull request #1051 from Moadong/refactor/#1050-year-semester-ty…
seongwon030 c892166
feat: 무한 재연결 로직 수정 및 타임아웃 클리어
lepitaaar af9b667
refactor: rename callbacks to eventHandlers
lepitaaar 4682a96
refactor: SSE 재연결 로직 개선
lepitaaar 41d41df
feat: Award 관련 유틸 함수 추가
seongwon030 0315198
test: awardHelpers 유틸 함수 단위 테스트 추가
seongwon030 c486f8d
refactor: ClubIntroContent 성능 최적화 및 코드 개선
seongwon030 197a255
fix: setState updater 함수에서 부작용 제거하여 React 규칙 준수
seongwon030 acb8628
Merge pull request #1068 from Moadong/refactor/#1067-club-intro-perfo…
seongwon030 2cf875c
Merge pull request #1062 from Moadong/feature/#798-sync-applicant-con…
lepitaaar bf225a6
fix: createApplicationSSE import 분리
seongwon030 93f2831
Merge pull request #1071 from Moadong/fix/SSE-import
seongwon030 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| import { EventSource } from 'eventsource'; | ||
| import API_BASE_URL from '@/constants/api'; | ||
| import { | ||
| ApplicantSSECallbacks, | ||
| ApplicantStatusEvent, | ||
| } from '@/types/applicants'; | ||
|
|
||
| export const createApplicantSSE = ( | ||
| applicationFormId: string, | ||
| eventHandlers: ApplicantSSECallbacks, | ||
| ): EventSource | null => { | ||
| let eventSource: EventSource | null = null; | ||
|
|
||
| const connect = (): EventSource | null => { | ||
| const accessToken = localStorage.getItem('accessToken'); | ||
| if (!accessToken) return null; | ||
|
|
||
lepitaaar marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| const source = new EventSource( | ||
| `${API_BASE_URL}/api/club/applicant/${applicationFormId}/sse`, | ||
| { | ||
| fetch: (input, init) => | ||
| fetch(input, { | ||
| ...init, | ||
| headers: { | ||
| ...init?.headers, | ||
| Authorization: `Bearer ${accessToken}`, | ||
| }, | ||
| credentials: 'include', | ||
| }), | ||
| }, | ||
| ); | ||
|
|
||
| source.addEventListener('applicant-status-changed', (e) => { | ||
| try { | ||
| const eventData: ApplicantStatusEvent = JSON.parse(e.data); | ||
| eventHandlers.onStatusChange(eventData); | ||
| } catch (parseError) { | ||
| console.error('SSE PARSING ERROR:', parseError); | ||
| } | ||
| }); | ||
|
|
||
| source.onerror = (error) => { | ||
| source.close(); | ||
| eventHandlers.onError( | ||
| new Error(error?.message || 'SSE connection error'), | ||
| ); | ||
| }; | ||
|
|
||
| return source; | ||
| }; | ||
|
|
||
| eventSource = connect(); | ||
| return eventSource; | ||
| }; | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.