mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-02 08:28:48 +01:00
fix(external-objects): scope issue deletion activation
Select distinct company-owned mention object IDs before the issue cascade and notify only those objects. Preserve shared references and unrelated future inventory without company-wide reconstruction. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
c2b8a6e05e
commit
18cf130c4e
3 files changed
+100
-3
No files matched your search
@@ -97,6 +97,7 @@ import {
|
||||
heartbeatRuns,
|
||||
routineRuns,
|
||||
executionWorkspaces,
|
||||
externalObjectMentions,
|
||||
issueApprovals,
|
||||
issueAccessGrants,
|
||||
issueAttachments,
|
||||
@@ -12028,7 +12029,14 @@ export function issueService(db: Db) {
|
||||
if (owner) {
|
||||
await notifyIssueAttentionRetentionWork(tx, { companyId: owner.companyId, issueId: id });
|
||||
await notifyExternalConversationSettlement(tx, { companyId: owner.companyId });
|
||||
await notifyExternalObjectRefresh(tx, owner.companyId);
|
||||
const mentionedObjects = await tx.selectDistinct({ objectId: externalObjectMentions.objectId })
|
||||
.from(externalObjectMentions)
|
||||
.where(and(
|
||||
eq(externalObjectMentions.companyId, owner.companyId),
|
||||
eq(externalObjectMentions.sourceIssueId, id),
|
||||
isNotNull(externalObjectMentions.objectId),
|
||||
));
|
||||
for (const mention of mentionedObjects) await notifyExternalObjectRefresh(tx, owner.companyId, mention.objectId!);
|
||||
await notifyApprovalWork(tx, owner.companyId);
|
||||
await notifyStatusCardIssueChange(tx, owner.companyId);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user