Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 36 minutes and 49 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
WalkthroughESLint 규칙을 강화하고 런타임 타입 안전성을 개선하는 PR입니다. Possibly related PRs
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 5
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
eslint.config.js (1)
3-5: 🛠️ Refactor suggestion | 🟠 Major
eslint-plugin-react-x와eslint-plugin-react-dom플러그인을 설치하고 구성해야 합니다.현재 설정은 기존의
eslint-plugin-react기반이지만, 코딩 가이드라인에서는 moderneslint-react에코시스템의eslint-plugin-react-x와eslint-plugin-react-dom을 flat config로 구성하도록 요구합니다. 이들은 React DOM 최적화 규칙과 최신 React 베스트 프랙티스를 제공합니다.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@eslint.config.js` around lines 3 - 5, Replace the legacy eslint-plugin-react setup with the modern flat-config plugins: install and import "eslint-plugin-react-x" and "eslint-plugin-react-dom" instead of "eslint-plugin-react", keep "eslint-plugin-react-hooks" and "eslint-plugin-react-refresh", then update the flat config to register the new plugins (e.g., the imported symbols replacing react) and enable the recommended rule sets from "react-x" and "react-dom" (including React DOM optimization rules); specifically, change the import lines (current react, reactHooks, reactRefresh) to import reactX and reactDom, add those plugin references to the exports/config registration, and migrate any react-specific rule names to the equivalents provided by react-x/react-dom.
🧹 Nitpick comments (5)
src/types/navigation.ts (1)
1-8:backState재귀 타입 고려현재
backState는{ from?: string }으로 제한되어 있어, 다단계 뒤로가기 체이닝(예: A → B → C에서 뒤로가기 시 B의backPath/backState전달)이 필요한 경우 타입이 막힐 수 있습니다. 필요 시 재귀 타입으로 확장 고려해보세요. 지금 사용처에서는from만 쓰이므로 필수는 아닙니다.♻️ 참고용 제안
export interface SmartBackState { backPath?: string; backReplace?: boolean; - backState?: { - from?: string; - }; + backState?: SmartBackState; from?: string; }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/types/navigation.ts` around lines 1 - 8, SmartBackState currently defines backState as a flat object ({ from?: string }) which blocks multi-level back-chain data; change backState to a recursive type so it can optionally nest another SmartBackState (e.g., backState?: SmartBackState | { from?: string } or make backState?: SmartBackState) by updating the SmartBackState declaration and any consumers (functions/types that construct or read backState) to accept the recursive shape, ensuring existing usages that only read from are still compatible.src/pages/Chat/ChatRoomInfo.tsx (1)
242-242: onClick이 Promise를 반환합니다.
() => handleLeaveRoom()은Promise<void>를 반환하므로no-misused-promises의checksVoidReturn설정에 걸릴 수 있습니다. 블록 본문으로 감싸 Promise를 버리는 편이 안전합니다.♻️ 제안
- onClick={() => handleLeaveRoom()} + onClick={() => { + handleLeaveRoom(); + }}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/pages/Chat/ChatRoomInfo.tsx` at line 242, The onClick currently returns a Promise because it uses "() => handleLeaveRoom()", which triggers the no-misused-promises checks; modify the handler so the click callback is a block-bodied function that explicitly discards the Promise (e.g., call handleLeaveRoom and void its result or await inside an async wrapper), preventing a Promise from being returned from the onClick. Update the JSX where onClick is set and ensure references to handleLeaveRoom remain unchanged.package.json (1)
45-46: devDependencies 알파벳 순서.
@tanstack/eslint-plugin-query는@스코프라@vitejs/plugin-react근처(또는@tanstack류 위쪽)에 정렬되어야 합니다. 현재eslint-plugin-react-refresh바로 아래에 위치하여 정렬이 어긋납니다.♻️ 제안
"@sentry/vite-plugin": "^5.1.1", + "@tanstack/eslint-plugin-query": "^5.99.2", "@types/babel__core": "^7.20.5", @@ "eslint-plugin-react-refresh": "^0.4.24", - "@tanstack/eslint-plugin-query": "^5.99.2", "globals": "^16.5.0",🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@package.json` around lines 45 - 46, The devDependencies are not alphabetically ordered: "@tanstack/eslint-plugin-query" is placed after "eslint-plugin-react-refresh" which breaks sorting for scoped packages; reorder the entries so that scoped packages like "@tanstack/eslint-plugin-query" appear in their correct alphabetical position (near other "@" scoped entries such as "@vitejs/plugin-react" or above unscoped "eslint-plugin-react-refresh") by moving the "@tanstack/eslint-plugin-query" line to the proper location in package.json's devDependencies.src/pages/Manager/ManagedAccount/index.tsx (1)
29-29:as단언 대신 타입 가드 고려.
location.state는unknown이라 단순as는 런타임에서 형태가 다를 경우 그대로 통과합니다.typed linting을 강화한 취지를 살리려면 작은 타입 가드(e.g.isEnableAfterSaveState)로 좁히는 편이 더 안전합니다. 현재는 optional 필드 하나라 영향이 작으니 선택 사항입니다.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/pages/Manager/ManagedAccount/index.tsx` at line 29, Replace the unsafe cast of location.state to EnableAfterSaveState with a runtime type guard: implement an isEnableAfterSaveState(value: unknown): value is EnableAfterSaveState that checks the optional fields you expect, then set navigationState by testing location.state with that guard (e.g., navigationState = isEnableAfterSaveState(location.state) ? location.state : null) so the narrowing is done safely at runtime instead of using a raw `as` assertion; reference the symbols navigationState and EnableAfterSaveState and add the isEnableAfterSaveState helper near this component.eslint.config.js (1)
100-110: rawfetch제한에globalThis/self도 포함해 주세요.현재 selector는
fetch()와window.fetch()만 막아서globalThis.fetch()나self.fetch()로 우회할 수 있습니다.🔒 제안 수정
{ - selector: - "CallExpression[callee.type='MemberExpression'][callee.object.type='Identifier'][callee.object.name='window'][callee.property.type='Identifier'][callee.property.name='fetch']", + selector: + "CallExpression[callee.type='MemberExpression'][callee.object.type='Identifier'][callee.object.name=/^(window|globalThis|self)$/][callee.property.type='Identifier'][callee.property.name='fetch']", message: 'fetch 직접 호출 대신 apiClient를 사용하세요. 예외가 필요한 경우 허용 파일에서만 사용하세요.', },🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@eslint.config.js` around lines 100 - 110, The ESLint rule 'no-restricted-syntax' currently blocks direct fetch and window.fetch but allows globalThis.fetch and self.fetch; update the rule (the 'no-restricted-syntax' entry) to add selectors that match MemberExpression calls where the object is globalThis or self (e.g., CallExpression[callee.type='MemberExpression'][callee.object.type='Identifier'][callee.object.name='globalThis'][callee.property.type='Identifier'][callee.property.name='fetch'] and the same for 'self') so those forms are also disallowed with the same message as the existing window.fetch selector.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@eslint.config.js`:
- Around line 50-57: Enable the '@typescript-eslint/no-floating-promises' rule
by setting it to 'error' in the ESLint config so that unawaited Promises (e.g.,
calls like bootstrap();) are flagged; update the rules block that currently
contains '@typescript-eslint/no-non-null-assertion' and
'@typescript-eslint/no-misused-promises' to include
"@typescript-eslint/no-floating-promises": "error" (ensuring it aligns with the
existing 'no-void'/'no-void: error' usage if present).
In `@src/main.tsx`:
- Around line 19-20: bootstrap() can reject (dynamic import or root element
check) and needs an explicit rejection handler to avoid leaving the initial
screen blank; update the code that calls bootstrap() to append a .catch(...)
handler that logs the error (e.g., console.error or processLogger.error) and
displays/falls back to an error UI or mount a minimal fallback DOM message,
while noting startSessionRestore() / useAuthStore.getState().initialize()
already handles its own errors and does not need changes. Ensure you locate the
call to bootstrap() and add the .catch that handles/report the error and
prevents an unhandled rejection.
In `@src/pages/Manager/ManagedMemberList/index.tsx`:
- Line 163: The onSubmit prop expects a synchronous () => void but you are
passing the async Promise-returning roleManage.handleSubmit() directly; change
the prop to pass a non-async wrapper that calls roleManage.handleSubmit() and
handles the Promise (e.g., call it and attach a .catch to log/handle errors or
use void to ignore the returned Promise) so the type becomes () => void; update
the JSX where RoleManageModal is used (the onSubmit prop) to call
roleManage.handleSubmit() inside a plain arrow function and ensure any errors
are caught.
In `@src/pages/Notifications/index.tsx`:
- Around line 106-108: The catch block currently calls
queryClient.invalidateQueries(notificationQueryKeys.inbox.all()) without
awaiting or handling its returned Promise, which leaves a floating promise and
can trigger no-floating-promises lint errors or silent failures; update the
catch to either await queryClient.invalidateQueries(...) (i.e., make the
surrounding function async if needed) or explicitly swallow errors with
queryClient.invalidateQueries(...).catch(() => {}) to make intent clear, and
apply the same change to the identical pattern in
src/components/notification/InboxNotificationLayer.tsx so both uses of
queryClient.invalidateQueries and notificationQueryKeys.inbox.all() are handled
consistently.
In `@src/utils/ts/cookie.ts`:
- Around line 3-9: The cookie setter currently stores String(value) raw, which
breaks when the value contains characters like ";" or "="; update the code that
builds the cookie (where serializedValue is created and used) to use
encodeURIComponent(serializedValue) before assigning document.cookie, and update
the corresponding getCookie function to decode the stored value with
decodeURIComponent when returning it; ensure you use the same serializedValue
identifier and the getCookie function name so encoding/decoding pairs match.
---
Outside diff comments:
In `@eslint.config.js`:
- Around line 3-5: Replace the legacy eslint-plugin-react setup with the modern
flat-config plugins: install and import "eslint-plugin-react-x" and
"eslint-plugin-react-dom" instead of "eslint-plugin-react", keep
"eslint-plugin-react-hooks" and "eslint-plugin-react-refresh", then update the
flat config to register the new plugins (e.g., the imported symbols replacing
react) and enable the recommended rule sets from "react-x" and "react-dom"
(including React DOM optimization rules); specifically, change the import lines
(current react, reactHooks, reactRefresh) to import reactX and reactDom, add
those plugin references to the exports/config registration, and migrate any
react-specific rule names to the equivalents provided by react-x/react-dom.
---
Nitpick comments:
In `@eslint.config.js`:
- Around line 100-110: The ESLint rule 'no-restricted-syntax' currently blocks
direct fetch and window.fetch but allows globalThis.fetch and self.fetch; update
the rule (the 'no-restricted-syntax' entry) to add selectors that match
MemberExpression calls where the object is globalThis or self (e.g.,
CallExpression[callee.type='MemberExpression'][callee.object.type='Identifier'][callee.object.name='globalThis'][callee.property.type='Identifier'][callee.property.name='fetch']
and the same for 'self') so those forms are also disallowed with the same
message as the existing window.fetch selector.
In `@package.json`:
- Around line 45-46: The devDependencies are not alphabetically ordered:
"@tanstack/eslint-plugin-query" is placed after "eslint-plugin-react-refresh"
which breaks sorting for scoped packages; reorder the entries so that scoped
packages like "@tanstack/eslint-plugin-query" appear in their correct
alphabetical position (near other "@" scoped entries such as
"@vitejs/plugin-react" or above unscoped "eslint-plugin-react-refresh") by
moving the "@tanstack/eslint-plugin-query" line to the proper location in
package.json's devDependencies.
In `@src/pages/Chat/ChatRoomInfo.tsx`:
- Line 242: The onClick currently returns a Promise because it uses "() =>
handleLeaveRoom()", which triggers the no-misused-promises checks; modify the
handler so the click callback is a block-bodied function that explicitly
discards the Promise (e.g., call handleLeaveRoom and void its result or await
inside an async wrapper), preventing a Promise from being returned from the
onClick. Update the JSX where onClick is set and ensure references to
handleLeaveRoom remain unchanged.
In `@src/pages/Manager/ManagedAccount/index.tsx`:
- Line 29: Replace the unsafe cast of location.state to EnableAfterSaveState
with a runtime type guard: implement an isEnableAfterSaveState(value: unknown):
value is EnableAfterSaveState that checks the optional fields you expect, then
set navigationState by testing location.state with that guard (e.g.,
navigationState = isEnableAfterSaveState(location.state) ? location.state :
null) so the narrowing is done safely at runtime instead of using a raw `as`
assertion; reference the symbols navigationState and EnableAfterSaveState and
add the isEnableAfterSaveState helper near this component.
In `@src/types/navigation.ts`:
- Around line 1-8: SmartBackState currently defines backState as a flat object
({ from?: string }) which blocks multi-level back-chain data; change backState
to a recursive type so it can optionally nest another SmartBackState (e.g.,
backState?: SmartBackState | { from?: string } or make backState?:
SmartBackState) by updating the SmartBackState declaration and any consumers
(functions/types that construct or read backState) to accept the recursive
shape, ensuring existing usages that only read from are still compatible.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: c6a67cff-854c-4ab7-b6a0-6a0d10b6c9f8
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml,!pnpm-lock.yamland included by**
📒 Files selected for processing (37)
eslint.config.jspackage.jsonsrc/apis/auth/index.tssrc/apis/chat/queries.tssrc/apis/client.tssrc/apis/club/queries.tssrc/apis/notification/index.tssrc/components/common/ImageUploader/hooks/useImagePreparation.tssrc/components/layout/Header/components/ChatHeader.tsxsrc/components/notification/InboxNotificationLayer.tsxsrc/components/notification/hooks/useInboxNotificationStream.tssrc/constants/timer.tssrc/main.tsxsrc/pages/Auth/SignUp/components/AgreementArrow.tsxsrc/pages/Chat/ChatRoomInfo.tsxsrc/pages/Chat/components/ChatRoomListItem.tsxsrc/pages/Chat/hooks/useChat.tssrc/pages/Chat/hooks/useChatRoomScroll.tssrc/pages/Council/CouncilNotice/hooks/useCouncilNoticeDetail.tssrc/pages/Home/components/HomeClubSection.tsxsrc/pages/Home/hooks/useInfiniteClubCarousel.tssrc/pages/Manager/ManagedAccount/index.tsxsrc/pages/Manager/ManagedMemberList/hooks/useRoleManage.tssrc/pages/Manager/ManagedMemberList/index.tsxsrc/pages/Manager/ManagedRecruitmentForm/index.tsxsrc/pages/Manager/ManagedRecruitmentWrite/index.tsxsrc/pages/Manager/types.tssrc/pages/Notifications/index.tsxsrc/pages/Timer/hooks/useStudyTimer.tssrc/pages/Timer/index.tsxsrc/pages/User/MyPage/index.tsxsrc/stores/authStore.tssrc/types/navigation.tssrc/utils/hooks/useSmartBack.tssrc/utils/ts/cookie.tssrc/utils/ts/error/apiError.tssrc/utils/ts/nativeBridge.ts
| '@typescript-eslint/no-non-null-assertion': 'error', | ||
| '@typescript-eslint/no-floating-promises': 'off', | ||
| '@typescript-eslint/no-misused-promises': [ | ||
| 'error', | ||
| { | ||
| checksVoidReturn: false, | ||
| }, | ||
| ], |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
cd / && find . -name "eslint.config.js" -o -name "eslint.config.ts" 2>/dev/null | head -5Repository: BCSDLab/KONECT_FRONT_END
Length of output: 254
🏁 Script executed:
cat -n eslint.config.js | head -80Repository: BCSDLab/KONECT_FRONT_END
Length of output: 3425
🌐 Web query:
typescript-eslint no-floating-promises ignoreVoid option
💡 Result:
The @typescript-eslint/no-floating-promises rule includes an ignoreVoid option that determines whether to ignore void expressions prefixed to promises. When enabled (true), the rule does not report promises intentionally marked with the void operator, such as void someAsyncFn;. This is the default setting. Key details: - Default: true - Purpose: Allows explicit marking of intentionally unawaited promises using void, as a convenient alternative to ESLint disable comments. - Warning: Using void does not handle promise rejections at runtime; they remain unhandled, similar to disabling the rule. - Compatibility note: If using the no-void rule with allowAsStatement: true, void can be used in statements. - Configuration example: { "@typescript-eslint/no-floating-promises": ["error", { "ignoreVoid": true }] } This option is part of the rule's configuration object, alongside others like ignoreIIFE, checkThenables, allowForKnownSafeCalls, and allowForKnownSafePromises. The official documentation confirms this behavior and provides examples of valid code with { ignoreVoid: true }, such as void returnsPromise; and void Promise.reject('value');.
Citations:
- 1: https://typescript-eslint.io/rules/no-floating-promises/
- 2: https://typescript-eslint.io/rules/no-floating-promises
no-floating-promises를 활성화하세요.
현재 설정에서는 bootstrap(); 같은 미처리 Promise가 그대로 통과됩니다. no-void: error와 함께 작동하려면 no-floating-promises를 다시 켜야 합니다.
수정 제안
- '@typescript-eslint/no-floating-promises': 'off',
+ '@typescript-eslint/no-floating-promises': ['error', { ignoreVoid: false }],📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| '@typescript-eslint/no-non-null-assertion': 'error', | |
| '@typescript-eslint/no-floating-promises': 'off', | |
| '@typescript-eslint/no-misused-promises': [ | |
| 'error', | |
| { | |
| checksVoidReturn: false, | |
| }, | |
| ], | |
| '@typescript-eslint/no-non-null-assertion': 'error', | |
| '@typescript-eslint/no-floating-promises': ['error', { ignoreVoid: false }], | |
| '@typescript-eslint/no-misused-promises': [ | |
| 'error', | |
| { | |
| checksVoidReturn: false, | |
| }, | |
| ], |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@eslint.config.js` around lines 50 - 57, Enable the
'@typescript-eslint/no-floating-promises' rule by setting it to 'error' in the
ESLint config so that unawaited Promises (e.g., calls like bootstrap();) are
flagged; update the rules block that currently contains
'@typescript-eslint/no-non-null-assertion' and
'@typescript-eslint/no-misused-promises' to include
"@typescript-eslint/no-floating-promises": "error" (ensuring it aligns with the
existing 'no-void'/'no-void: error' usage if present).
| onClose={roleManage.close} | ||
| onMemberClick={roleManage.handleMemberClick} | ||
| onSubmit={() => void roleManage.handleSubmit()} | ||
| onSubmit={() => roleManage.handleSubmit()} |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: onSubmit prop contract and async handleSubmit return verification.
rg -n -C3 'onSubmit:\s*\(\)\s*=>\s*void|const handleSubmit\s*=\s*async|onSubmit=\{\(\)\s*=>\s*roleManage\.handleSubmit\(\)\}' src/pages/Manager/ManagedMemberListRepository: BCSDLab/KONECT_FRONT_END
Length of output: 3462
🏁 Script executed:
# Get full handleSubmit implementation
sed -n '97,120p' src/pages/Manager/ManagedMemberList/hooks/useRoleManage.tsRepository: BCSDLab/KONECT_FRONT_END
Length of output: 841
🏁 Script executed:
# Check how other onSubmit handlers are implemented in this file
grep -n "onSubmit=" src/pages/Manager/ManagedMemberList/index.tsxRepository: BCSDLab/KONECT_FRONT_END
Length of output: 222
🏁 Script executed:
# Check if there are other async functions passed to void callbacks
rg -n "onSubmit.*\(\)\s*=>\s*\{|handleSubmit|handleAddMember|handleImport" src/pages/Manager/ManagedMemberList --max-count 20Repository: BCSDLab/KONECT_FRONT_END
Length of output: 1231
🏁 Script executed:
# Get full useAddMember.ts handleSubmit to compare with async version
sed -n '18,35p' src/pages/Manager/ManagedMemberList/hooks/useAddMember.tsRepository: BCSDLab/KONECT_FRONT_END
Length of output: 452
🏁 Script executed:
# Get full useMemberSheetImport.ts handleSubmit
sed -n '70,90p' src/pages/Manager/ManagedMemberList/hooks/useMemberSheetImport.tsRepository: BCSDLab/KONECT_FRONT_END
Length of output: 617
🏁 Script executed:
# Get the complete async handleSubmit from useRoleManage to see all branches
sed -n '97,160p' src/pages/Manager/ManagedMemberList/hooks/useRoleManage.tsRepository: BCSDLab/KONECT_FRONT_END
Length of output: 2085
onSubmit 콜백의 타입 계약을 맞춰주세요.
RoleManageModal의 onSubmit은 () => void이지만, 현재는 async 함수인 roleManage.handleSubmit()이 반환하는 Promise<void>를 그대로 전달합니다. TypeScript 타입 검사 및 linting에서 문제가 될 수 있습니다.
수정 방법
- onSubmit={() => roleManage.handleSubmit()}
+ onSubmit={() => {
+ void roleManage.handleSubmit();
+ }}또는 catch 처리:
- onSubmit={() => roleManage.handleSubmit()}
+ onSubmit={() => {
+ roleManage.handleSubmit().catch(() => {});
+ }}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| onSubmit={() => roleManage.handleSubmit()} | |
| onSubmit={() => { | |
| void roleManage.handleSubmit(); | |
| }} |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/pages/Manager/ManagedMemberList/index.tsx` at line 163, The onSubmit prop
expects a synchronous () => void but you are passing the async Promise-returning
roleManage.handleSubmit() directly; change the prop to pass a non-async wrapper
that calls roleManage.handleSubmit() and handles the Promise (e.g., call it and
attach a .catch to log/handle errors or use void to ignore the returned Promise)
so the type becomes () => void; update the JSX where RoleManageModal is used
(the onSubmit prop) to call roleManage.handleSubmit() inside a plain arrow
function and ensure any errors are caught.
| } catch { | ||
| void queryClient.invalidateQueries({ queryKey: notificationQueryKeys.inbox.all() }); | ||
| queryClient.invalidateQueries({ queryKey: notificationQueryKeys.inbox.all() }); | ||
| } |
There was a problem hiding this comment.
invalidateQueries의 rejection이 무시됩니다.
void를 제거하면서 queryClient.invalidateQueries(...)가 반환하는 Promise가 그대로 catch 블록에 남게 됩니다. no-floating-promises가 활성화되어 있다면 린트에서 걸릴 수 있고, 실패 시 무응답으로 넘어가 디버깅이 어렵습니다. 명시적으로 await하거나 실패를 무시할 의도라면 .catch(() => {})를 붙이는 편이 의도가 분명합니다.
♻️ 제안
- } catch {
- queryClient.invalidateQueries({ queryKey: notificationQueryKeys.inbox.all() });
- }
+ } catch {
+ await queryClient.invalidateQueries({ queryKey: notificationQueryKeys.inbox.all() });
+ }동일 패턴이 src/components/notification/InboxNotificationLayer.tsx에도 있어 함께 일관되게 적용하시면 좋습니다.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| } catch { | |
| void queryClient.invalidateQueries({ queryKey: notificationQueryKeys.inbox.all() }); | |
| queryClient.invalidateQueries({ queryKey: notificationQueryKeys.inbox.all() }); | |
| } | |
| } catch { | |
| await queryClient.invalidateQueries({ queryKey: notificationQueryKeys.inbox.all() }); | |
| } |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/pages/Notifications/index.tsx` around lines 106 - 108, The catch block
currently calls queryClient.invalidateQueries(notificationQueryKeys.inbox.all())
without awaiting or handling its returned Promise, which leaves a floating
promise and can trigger no-floating-promises lint errors or silent failures;
update the catch to either await queryClient.invalidateQueries(...) (i.e., make
the surrounding function async if needed) or explicitly swallow errors with
queryClient.invalidateQueries(...).catch(() => {}) to make intent clear, and
apply the same change to the identical pattern in
src/components/notification/InboxNotificationLayer.tsx so both uses of
queryClient.invalidateQueries and notificationQueryKeys.inbox.all() are handled
consistently.
✨ 요약
😎 해결한 이슈
Summary by CodeRabbit
Release Notes
Bug Fixes
Chores