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

オープン 初心者向け
#43 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
76/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
postgresql, typescript
領域
backend, databases

調査の方向性

apps/api/src/instagram/services/instagram-automation-runner.service.tsから始め、名前の挙がっている3つの呼び出し箇所とresolveExecutableActionNodesを読みます。各呼び出しがInstagramアカウントの会社IDをどのように取得するかを追い、続いてラウンドロビン割り当てがIDの欠落をどのように処理するかを確認します。3つの呼び出しすべてが会社IDを渡し、割り当てによって他社のユーザーを検索できない状態になれば完了です。payloadにはテストファイル名は記載されていません。

索引モデルが issue の本文から書いたものです。

説明

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 }).
主要言語
TypeScript
スター
2
フォーク
1
平均マージ
6分
マージ済み PR(30日)
27

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

sumamakhan761/tryinstance のほかの issue

sumamakhan761/tryinstance の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。