Skip to content

Commit ae8eadb

Browse files
committed
normal notifications, no reviewer email notifications
1 parent 4af9be8 commit ae8eadb

File tree

3 files changed

+33
-43
lines changed

3 files changed

+33
-43
lines changed

src/lib/server/job-executors/system.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -902,6 +902,7 @@ async function tryCreateInstance(
902902
includeFields: [],
903903
includeArtifacts: null,
904904
includeReviewers: false,
905+
isAutomatic: false,
905906
environment: mergedEnv,
906907
start: ActivityName as WorkflowState
907908
} satisfies WorkflowInstanceContext),

src/lib/server/workflow/dbProcedures.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ProductTransitionType } from '../../prisma';
2+
import { BullMQ, getQueues } from '../bullmq';
23
import { DatabaseWrites } from '../database';
34
import { DatabaseReads } from '../database/prisma';
4-
import { BullMQ, getQueues } from '../bullmq';
55

66
export async function deleteWorkflow(productId: string) {
77
const product = await DatabaseReads.products.findUnique({

src/lib/server/workflow/state-machine.ts

Lines changed: 31 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ import {
1414
WorkflowAction,
1515
WorkflowOptions,
1616
WorkflowState,
17+
autoPublishOnRebuild,
1718
hasAuthors,
1819
hasReviewers,
19-
autoPublishOnRebuild,
2020
isAuthorState,
2121
isDeprecated,
2222
jump
@@ -712,50 +712,39 @@ export const WorkflowStateMachine = setup({
712712
}
713713
},
714714
[WorkflowState.Verify_and_Publish]: {
715-
entry: [
716-
assign({
717-
instructions: ({ context }) => {
718-
switch (context.productType) {
719-
case ProductType.Android_GooglePlay:
720-
return 'googleplay_verify_and_publish';
721-
case ProductType.Android_S3:
722-
return 'verify_and_publish';
723-
case ProductType.AssetPackage:
724-
return 'asset_package_verify_and_publish';
725-
case ProductType.Web:
726-
return 'web_verify';
727-
}
728-
},
729-
includeFields: ({ context }) => {
730-
switch (context.productType) {
731-
case ProductType.Android_GooglePlay:
732-
case ProductType.Android_S3:
733-
return ['storeDescription', 'listingLanguageCode'];
734-
case ProductType.AssetPackage:
735-
case ProductType.Web:
736-
return ['storeDescription'];
737-
}
738-
},
739-
includeReviewers: true,
740-
includeArtifacts: ({ context }) => {
741-
switch (context.productType) {
742-
case ProductType.AssetPackage:
743-
return 'latestAssetPackage';
744-
default:
745-
return 'all';
746-
}
715+
entry: assign({
716+
instructions: ({ context }) => {
717+
switch (context.productType) {
718+
case ProductType.Android_GooglePlay:
719+
return 'googleplay_verify_and_publish';
720+
case ProductType.Android_S3:
721+
return 'verify_and_publish';
722+
case ProductType.AssetPackage:
723+
return 'asset_package_verify_and_publish';
724+
case ProductType.Web:
725+
return 'web_verify';
747726
}
748-
}),
749-
({ context }) => {
750-
if (!context.isAutomatic) {
751-
return;
727+
},
728+
includeFields: ({ context }) => {
729+
switch (context.productType) {
730+
case ProductType.Android_GooglePlay:
731+
case ProductType.Android_S3:
732+
return ['storeDescription', 'listingLanguageCode'];
733+
case ProductType.AssetPackage:
734+
case ProductType.Web:
735+
return ['storeDescription'];
736+
}
737+
},
738+
includeReviewers: true,
739+
includeArtifacts: ({ context }) => {
740+
switch (context.productType) {
741+
case ProductType.AssetPackage:
742+
return 'latestAssetPackage';
743+
default:
744+
return 'all';
752745
}
753-
void getQueues().Emails.add(`Email reviewers for Product #${context.productId}`, {
754-
type: BullMQ.JobType.Email_SendNotificationToReviewers,
755-
productId: context.productId
756-
});
757746
}
758-
],
747+
}),
759748
exit: assign({
760749
includeReviewers: false,
761750
includeArtifacts: null

0 commit comments

Comments
 (0)