fix(bio-links): check all PUT responses on save, toast on upload errors, and wire slug validation in BioLinkStudio
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 84/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- nextjs, react, typescript
- Lĩnh vực
- frontend
Hướng nghiên cứu
Bắt đầu tại apps/web/components/bio-links/BioLinkStudio.tsx và lần theo handleSave, handleUploadImage cùng các props của ProfileSettingsCard; kiểm tra callback xác thực slug trong ProfileSettingsCard.tsx. Xác minh mọi phản hồi lưu đều được kiểm tra, lỗi tải lên hiển thị toast lỗi và slug không hợp lệ chặn việc lưu. Hoàn tất khi cả ba hành vi đều hoạt động và thao tác lưu thất bại không bao giờ hiển thị toast thành công.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem Description
In apps/web/components/bio-links/BioLinkStudio.tsx, there are three error-handling and validation gaps:
-
False success toast on partial save failure (
handleSave):
handleSavesends 5 sequentialPUTrequests (/api/bio-links/settings,buttons,links,products,faqs), but only checksif (!settingsRes.ok).
The 4 subsequentPUTcalls (buttons,links,products,faqs) never checkres.ok, so if any of them fail,handleSavestill setsisSaved(true)and showstoast.success('Bio link updated', 'All changes published successfully'). -
Silent image upload failures (
handleUploadImage):
handleUploadImagecatches upload errors from/api/bio-links/upload, logs to the console, and returnsnullwithout callingtoast.error(...). Child callers (ProfileSettingsCard.tsx,CustomLinksManager.tsx,ProductsManager.tsx) do not display an error toast whennullis returned either. -
Slug validation never wired to
<ProfileSettingsCard>:
BioLinkStudio.tsxdeclaresconst [isSlugValid, setIsSlugValid] = useState(true)and checksif (!isSlugValid)inhandleSave, andProfileSettingsCard.tsxalready acceptsonSlugValidationChange?: (isValid: boolean) => void. However,onSlugValidationChange={setIsSlugValid}is never passed to<ProfileSettingsCard>, leavingisSlugValidpermanentlytrue.
Expected Behavior
handleSavechecksres.okon allPUTrequests (settings,buttons,links,products,faqs) and throws/toasts an error if any request fails, without showingtoast.success(...).handleUploadImagesurfaces a cleartoast.error(...)message whenever image upload fails.<ProfileSettingsCard>receivesonSlugValidationChange={setIsSlugValid}so invalid, taken, or reserved handles block saving as intended.
Where to Look
apps/web/components/bio-links/BioLinkStudio.tsx(handleUploadImage,handleSave,<ProfileSettingsCard>usage)apps/web/components/bio-links/ProfileSettingsCard.tsx(onSlugValidationChange)
Solution / Implementation Guide
- In
BioLinkStudio.tsx(handleSave):- Extract a small response-checking helper (e.g.
assertOk(res, fallbackMsg)) and apply it to thebuttons,links,products, andfaqsPUTresponses just likesettingsRes.
- Extract a small response-checking helper (e.g.
- In
BioLinkStudio.tsx(handleUploadImage):- In the
catchblock (or on!res.ok), calltoast.error(...)with a user-facing message before returningnull.
- In the
- In
BioLinkStudio.tsx(<ProfileSettingsCard>):- Pass
onSlugValidationChange={setIsSlugValid}to<ProfileSettingsCard />.
- Pass
- Ngôn ngữ chính
- TypeScript
- Star
- 2
- Fork
- 1
- Merge trung bình
- 6 phút
- Pull request đã merge (30 ngày)
- 27
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của sumamakhan761/tryinstance
-
backend good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
sumamakhan761/tryinstance#65 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
backend good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
sumamakhan761/tryinstance#64 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
backend good first issue
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
sumamakhan761/tryinstance#63 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
backend good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
sumamakhan761/tryinstance#62 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
backend good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
sumamakhan761/tryinstance#60 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của sumamakhan761/tryinstance
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
makecindy/cindy#15342 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
kwitsch/claude-code-plugin-tooling#219 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
no-repo-link tool-submission
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 74/100
BraveOPotato/NoSignups#2618 ·
-
enhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100