Skip to content
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

Race condition in class Communication in package com.adroid.identity.wallet.transfer #462

Open
nicklaswj opened this issue Jan 30, 2024 · 0 comments · May be fixed by #463
Open

Race condition in class Communication in package com.adroid.identity.wallet.transfer #462

nicklaswj opened this issue Jan 30, 2024 · 0 comments · May be fixed by #463

Comments

@nicklaswj
Copy link

Expected Behavior

The method sendResponse on class Communication with the argument closeAfterSending = true (code), should only close the connection after the deviceResponse message has been sent.

Actual Behavior

If the connection and or latency on the underlying mTransport is slow enough, the above described call will close the connection before the deviceResponse has actually been sent.

Steps to Reproduce the Problem

  1. Open either the Purse or Wallet app on a real Phone (for my setup the emulator_speed/internet_speed ratio is too small to cause the race condition).
  2. Go to a www-mdl-reader website and open a mdoc url.
  3. Press the "Send data" button in the Purse or Wallet app.
  4. The www-mdl-reader will receiver no data, since the app closed the connection before the data was sent.

Specifications

  • Platform: Android 14 Samsung Galaxy S21 5G

Fix

I'll open a PR with a fix in a minute

nicklaswj pushed a commit to nicklaswj/identity-credential that referenced this issue Jan 30, 2024
….transfer.Communication sendResponse

If `closeAfterSending` is true, only close the connection after we know the
`deviceResponse` payload have been sent.
nicklaswj pushed a commit to nicklaswj/identity-credential that referenced this issue Feb 1, 2024
….transfer.Communication sendResponse

If `closeAfterSending` is true, only close the connection after we know the
`deviceResponse` payload have been sent.

Signed-off-by: Nicklas Warming Jacobsen <nicklas.jacobsen@ocrlabs.com>
nicklaswj pushed a commit to nicklaswj/identity-credential that referenced this issue Feb 1, 2024
….transfer.Communication sendResponse

If `closeAfterSending` is true, only close the connection after we know the
`deviceResponse` payload have been sent.

Signed-off-by: Nicklas Warming Jacobsen <nicklas.jacobsen@ocrlabs.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant