Skip to content

Commit bbd2fa8

Browse files
authored
Merge pull request #1409 from numbersprotocol/develop
Bump version to 0.51.1
2 parents 106c500 + 725f45d commit bbd2fa8

File tree

5 files changed

+24
-8
lines changed

5 files changed

+24
-8
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## 0.51.1 - 2022-03-23
9+
10+
### Fixed
11+
12+
- Prevent race condition when creating network action history record.
13+
814
## 0.51.0 - 2022-03-22
915

1016
### Added

android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ android {
66
applicationId "io.numbersprotocol.capturelite"
77
minSdkVersion rootProject.ext.minSdkVersion
88
targetSdkVersion rootProject.ext.targetSdkVersion
9-
versionCode 340
10-
versionName "0.51.0"
9+
versionCode 341
10+
versionName "0.51.1"
1111
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1212
}
1313
buildTypes {

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "capture-lite",
3-
"version": "0.51.0",
3+
"version": "0.51.1",
44
"author": "numbersprotocol",
55
"homepage": "https://numbersprotocol.io/",
66
"scripts": {

src/app/features/home/details/actions/actions.page.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff 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')

0 commit comments

Comments
 (0)