Skip to content

Commit 49a9ee3

Browse files
committed
normal notifications, no reviewer email notifications
1 parent 1063ec3 commit 49a9ee3

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
@@ -973,6 +973,7 @@ async function tryCreateInstance(
973973
includeFields: [],
974974
includeArtifacts: null,
975975
includeReviewers: false,
976+
isAutomatic: false,
976977
environment: mergedEnv,
977978
start: ActivityName as WorkflowState
978979
} 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
@@ -716,50 +716,39 @@ export const WorkflowStateMachine = setup({
716716
}
717717
},
718718
[WorkflowState.Verify_and_Publish]: {
719-
entry: [
720-
assign({
721-
instructions: ({ context }) => {
722-
switch (context.productType) {
723-
case ProductType.Android_GooglePlay:
724-
return 'googleplay_verify_and_publish';
725-
case ProductType.Android_S3:
726-
return 'verify_and_publish';
727-
case ProductType.AssetPackage:
728-
return 'asset_package_verify_and_publish';
729-
case ProductType.Web:
730-
return 'web_verify';
731-
}
732-
},
733-
includeFields: ({ context }) => {
734-
switch (context.productType) {
735-
case ProductType.Android_GooglePlay:
736-
case ProductType.Android_S3:
737-
return ['storeDescription', 'listingLanguageCode'];
738-
case ProductType.AssetPackage:
739-
case ProductType.Web:
740-
return ['storeDescription'];
741-
}
742-
},
743-
includeReviewers: true,
744-
includeArtifacts: ({ context }) => {
745-
switch (context.productType) {
746-
case ProductType.AssetPackage:
747-
return 'latestAssetPackage';
748-
default:
749-
return 'all';
750-
}
719+
entry: assign({
720+
instructions: ({ context }) => {
721+
switch (context.productType) {
722+
case ProductType.Android_GooglePlay:
723+
return 'googleplay_verify_and_publish';
724+
case ProductType.Android_S3:
725+
return 'verify_and_publish';
726+
case ProductType.AssetPackage:
727+
return 'asset_package_verify_and_publish';
728+
case ProductType.Web:
729+
return 'web_verify';
751730
}
752-
}),
753-
({ context }) => {
754-
if (!context.isAutomatic) {
755-
return;
731+
},
732+
includeFields: ({ context }) => {
733+
switch (context.productType) {
734+
case ProductType.Android_GooglePlay:
735+
case ProductType.Android_S3:
736+
return ['storeDescription', 'listingLanguageCode'];
737+
case ProductType.AssetPackage:
738+
case ProductType.Web:
739+
return ['storeDescription'];
740+
}
741+
},
742+
includeReviewers: true,
743+
includeArtifacts: ({ context }) => {
744+
switch (context.productType) {
745+
case ProductType.AssetPackage:
746+
return 'latestAssetPackage';
747+
default:
748+
return 'all';
756749
}
757-
void getQueues().Emails.add(`Email reviewers for Product #${context.productId}`, {
758-
type: BullMQ.JobType.Email_SendNotificationToReviewers,
759-
productId: context.productId
760-
});
761750
}
762-
],
751+
}),
763752
exit: assign({
764753
includeReviewers: false,
765754
includeArtifacts: null

0 commit comments

Comments
 (0)