fix(email-connectors): return profile-import error early in KlaviyoAdapter.upsertSubscriber
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ệ
- typescript
Hướng nghiên cứu
Đọc packages/email-connectors/src/adapters/klaviyo.adapter.ts, đặc biệt là KlaviyoAdapter.upsertSubscriber quanh các dòng 107-136. Theo dõi cách phản hồi từ /profile-import/ được xử lý trước yêu cầu tùy chọn về mối quan hệ với danh sách. Kết quả cần đạt là khi nhập hồ sơ thất bại, lỗi được trả về ngay mà không gửi yêu cầu danh sách; còn khi nhập thành công, hành vi hiện tại được giữ nguyên.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem Description
In packages/email-connectors/src/adapters/klaviyo.adapter.ts (upsertSubscriber, lines 86-136), when POST /profile-import/ fails (!profileRes.ok), profileId remains undefined. When listId is provided, the method still proceeds to call POST /lists/${listId}/relationships/profiles/ with id: undefined, which fails and masks the original /profile-import/ error behind "Failed to add to Klaviyo list: ...".
Expected Behavior
- If
POST /profile-import/returns a non-OK response (!profileRes.ok),upsertSubscribershould immediately return{ success: false, error: 'Failed to create Klaviyo profile: ...' }without making a wasted second request. - When
POST /profile-import/succeeds (profileRes.ok), behavior remains unchanged.
Where to Look
packages/email-connectors/src/adapters/klaviyo.adapter.ts(upsertSubscriber, lines 107-136)
Solution / Implementation Guide
- Right after
const profileRes = await fetch(...), checkif (!profileRes.ok)first:if (!profileRes.ok) { const errText = await profileRes.text(); return { success: false, error: `Failed to create Klaviyo profile: ${errText}` }; } - Parse
profileId = profileJson?.data?.id, and only proceed toPOST /lists/${listId}/relationships/profiles/whenlistIdis provided andprofileRes.oksucceeded.
- 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ó 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
-
backend bug good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
sumamakhan761/tryinstance#59 ·
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