Repository navigation
commit: T190 reoder recommendation ui - #52
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThêm service gọi API gợi ý nhập hàng và thay thế ChangesTích hợp gợi ý nhập hàng
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/services/replenishmentService.js`:
- Around line 6-11: Configure a finite timeout on the axios instance created by
replenishmentClient, alongside baseURL and headers, using the project’s
established timeout configuration or a suitable request limit. Ensure timed-out
requests reject so callers such as AlertsView can stop loading instead of
waiting indefinitely.
- Around line 31-49: Update normalizeReplenishmentError to preserve
error.response.status even when error.response.data is missing or empty. Keep
the existing response-data message and errors handling when available, but
return status 401 for bodyless unauthorized responses so the caller can redirect
correctly; retain the existing fallback only when no response status exists.
In `@src/views/AlertsView.vue`:
- Around line 38-57: Update the onMounted flow and loadDropdowns so
fetchSuggestions runs only when dropdown loading succeeds. Return an explicit
success/failure result from loadDropdowns, preserve non-401 errorMessage values,
and stop immediately after handling a 401 redirect so no additional request is
made.
- Around line 59-97: Ngăn các lần gọi fetchSuggestions chồng lấn để giữ state
phân trang nhất quán khi người dùng gửi applySearch hoặc applyFilter liên tục.
Thêm guard async ngay trong fetchSuggestions, sử dụng isLoading hoặc cơ chế
tương đương để bỏ qua yêu cầu mới khi request hiện tại chưa hoàn tất; bảo đảm cờ
vẫn được reset trong finally và giữ nguyên hành vi cập nhật dữ liệu, lỗi, lọc,
và chuyển hướng đăng nhập.
🪄 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: ASSERTIVE
Plan: Pro Plus
Run ID: a5b974fd-cf69-48f7-8513-45ea726d5292
📒 Files selected for processing (2)
src/services/replenishmentService.jssrc/views/AlertsView.vue
…suggestions fetch guard
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/views/AlertsView.vue (1)
67-90: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winKhông bỏ qua request mới sau khi state đã đổi.
Dòng 68 trả về khi đang loading, nhưng các hàm ở dòng 94-120 đã đổi
pagehoặc filter trước đó. Kết quả: response cũ có thể hiển thị dưới bộ lọc/trang mới. Hãy hủy request cũ hoặc dùng request id để chỉ áp dụng response mới nhất.Theo path instructions, cần ưu tiên “async flow, state consistency”.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/views/AlertsView.vue` around lines 67 - 90, Update fetchSuggestions so changing page or filters does not cause a newer request to be ignored while an older request is loading. Remove the isLoading early-return behavior and use request cancellation or a monotonically increasing request identifier to ensure only the latest getReplenishmentSuggestions response updates suggestions, pagination totals, and error state; preserve the existing loading cleanup and 401 redirect behavior.Source: Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@src/views/AlertsView.vue`:
- Around line 67-90: Update fetchSuggestions so changing page or filters does
not cause a newer request to be ignored while an older request is loading.
Remove the isLoading early-return behavior and use request cancellation or a
monotonically increasing request identifier to ensure only the latest
getReplenishmentSuggestions response updates suggestions, pagination totals, and
error state; preserve the existing loading cleanup and 401 redirect behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 17056b58-04c1-484f-a752-edfa2e80577a
📒 Files selected for processing (2)
src/services/replenishmentService.jssrc/views/AlertsView.vue
ThienlocTran
left a comment
There was a problem hiding this comment.
Reviewed. Kept current low-stock AlertsView to avoid route regression; preserved replenishment service for the existing backend endpoint.
check và merge code giúp tui
Summary by CodeRabbit