fix(automations): pass companyId into resolveExecutableActionNodes to scope round-robin user assignment

Đang mở Phù hợp với người mới
#43 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

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
76/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ệ
postgresql, typescript
Lĩnh vực
backend, databases

Hướng nghiên cứu

Bắt đầu từ apps/api/src/instagram/services/instagram-automation-runner.service.ts và đọc ba vị trí gọi được nêu cùng với resolveExecutableActionNodes. Theo dõi cách mỗi lời gọi lấy ID công ty của tài khoản Instagram, sau đó kiểm tra cách phân công round-robin xử lý trường hợp thiếu ID. Công việc hoàn tất khi cả ba lời gọi đều truyền ID công ty và việc phân công không thể truy vấn người dùng ở các công ty khác nhau; payload không nêu tên tệp kiểm thử nào.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

backend bug
Problem Description

In apps/api/src/instagram/services/instagram-automation-runner.service.ts (resolveExecutableActionNodes, lines 1027-1035), ACTION_SET_VARIABLE round-robin user assignment checks:
context.companyId ? { companyId: context.companyId } : { companyId: { not: null } }

However, companyId is never passed in context at any of the 3 call sites (resumeWaitingExecution line 379, triggerMatchingAutomations line 748, executeAutomationBranchPath line 1728). As a result, context.companyId is always undefined, causing round-robin assignment to query users across all companies instead of only the current workspace.


Expected Behavior
  1. companyId must always be passed into resolveExecutableActionNodes from all runner call sites.
  2. Round-robin assignment must fail closed (skip/error) if context.companyId is missing, rather than falling back to { companyId: { not: null } }.

Where to Look
  • apps/api/src/instagram/services/instagram-automation-runner.service.ts (resumeWaitingExecution, triggerMatchingAutomations, executeAutomationBranchPath, resolveExecutableActionNodes)

Solution / Implementation Guide
  1. Pass companyId: instagramAccount.companyId in the context object at resumeWaitingExecution (L379), triggerMatchingAutomations (L748), and executeAutomationBranchPath (L1728).
  2. Inside resolveExecutableActionNodes (L1027-1035), remove the { companyId: { not: null } } fallback and require context.companyId (or resolve assignToUserIds scoped strictly to { companyId: context.companyId }).
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

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của sumamakhan761/tryinstance

Tất cả issue của sumamakhan761/tryinstance

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.