Skip to content

Fix data race in BLE GATT implementation #1020

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

spheroid
Copy link
Contributor

@spheroid spheroid commented Jun 2, 2025

Set the wait condition before actually writing the value in the characteristic, as the callback that reads the value might be called before the value is actually set.

Test: ./gradlew multipaz:check multipaz:connectedCheck
Test: Manually tested local build with our wallet implementation

Fixes #1019

spheroid added 2 commits June 2, 2025 17:13
Set the wait condition before actually writing the value in the characteristic, as the callback that reads the value might be called before the value is actually set.

Test: ./gradlew multipaz:check multipaz:connectedCheck
Test: Manually tested local build with our wallet implementation

Signed-off-by: Henry Jalonen <[email protected]>
Signed-off-by: Henry Jalonen <[email protected]>
Copy link
Contributor

@davidz25 davidz25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM except for the unrelated changes to JsonWebEncryptionTests.kt and JsonWebSignatureTests.kt - any chance you can do a new PR without those changes?

@@ -56,7 +56,7 @@ class JsonWebEncryptionTests {
Curve.P_256,
recipientKey.publicKey.javaPublicKey as ECPublicKey,
recipientKey.javaPrivateKey as ECPrivateKey,
null, null, null, null, null, null, null, null, null
null, null, null, null, null, null, null, null, null, null, null, null
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this change needed?

@@ -120,7 +116,7 @@ class JsonWebSignatureTests {
Curve.P_256,
signingKey.publicKey.javaPublicKey as ECPublicKey,
signingKey.javaPrivateKey as ECPrivateKey,
null, null, null, null, null, null, null, null, null
null, null, null, null, null, null, null, null, null, null, null, null
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, why is this needed?

@davidz25
Copy link
Contributor

davidz25 commented Jun 3, 2025

Ah, OK, I now realize you had two commits so I'll just merge both. In the future please use separate PRs for separate fixes, it's easier to review that way - thanks!

@davidz25 davidz25 merged commit df7ac5f into openwallet-foundation-labs:main Jun 3, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BLE GATT randomly hangs on some Android devices
2 participants