Skip to content

Commit

Permalink
Don't write productId, authors, or reviewers to snapshot
Browse files Browse the repository at this point in the history
Even better, just don't write the productId (or the other dynamically calculated fields) in the first place
  • Loading branch information
FyreByrd committed Oct 28, 2024
1 parent 36ee7dd commit 7441cc0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion source/SIL.AppBuilder.Portal/common/public/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,5 +188,5 @@ export type StateNode = {

export type Snapshot = {
value: string;
context: WorkflowContext;
context: Omit<WorkflowContext, 'productId' | 'hasAuthors' | 'hasReviewers'>;
};
16 changes: 14 additions & 2 deletions source/SIL.AppBuilder.Portal/common/workflow/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,25 @@ export class Workflow {
ProductId: this.productId,
Snapshot: JSON.stringify({
value: Workflow.stateName(this.currentState),
context: context
context: {
...context,
// don't write these values
productId: undefined,
hasAuthors: undefined,
hasReviewers: undefined
}
} as Snapshot)
},
update: {
Snapshot: JSON.stringify({
value: Workflow.stateName(this.currentState),
context: context
context: {
...context,
// don't write these values
productId: undefined,
hasAuthors: undefined,
hasReviewers: undefined
}
} as Snapshot)
}
});
Expand Down

0 comments on commit 7441cc0

Please sign in to comment.