File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
src/app/features/home/details/actions Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -142,9 +142,19 @@ export class ActionsPage {
142142 concatMap ( orderId =>
143143 this . blockingActionService . run$ ( this . confirmOrder$ ( orderId ) )
144144 ) ,
145- tap ( networkAppOrder =>
146- this . createOrderHistory$ ( networkAppOrder ) . subscribe ( )
147- ) ,
145+ tap ( networkAppOrder => {
146+ /*
147+ Workaround:
148+ Create a order history record only if the total cost is > 0 to prevent race condition
149+ between app creating the order history record v.s. bubble workflow checking whether a
150+ record already exists and if not create a new one, especially for network actions that
151+ don't require any cost (and hence backend calls the webhook immediately). See
152+ https://dt42-numbers.slack.com/archives/C0323488MEJ/p1648006014291339
153+ */
154+ if ( Number ( networkAppOrder . total_cost ) !== 0 ) {
155+ this . createOrderHistory$ ( networkAppOrder ) . subscribe ( ) ;
156+ }
157+ } ) ,
148158 tap ( ( ) => {
149159 this . snackBar . open (
150160 this . translocoService . translate ( 'message.sentSuccessfully' )
You can’t perform that action at this time.
0 commit comments