Uh oh!
There was an error while loading. Please reload this page.
Run AsyncResource completions on EDT in InternalCallback - #14
Conversation
shai-almog
commented
Mar 18, 2026
@shannah can you please review? |
There was a problem hiding this comment.
Pull request overview
This PR updates InternalCallback in the fingerprint module to ensure AsyncResource terminal handlers (complete/error/cancel) execute on Codename One’s EDT, reducing UI-threading hazards in native callback paths.
Changes:
- Wrap
req.complete(...),req.error(...), andreq.cancel(...)inDisplay.getInstance().callSerially(...)so terminal events run on the EDT. - Add an inner
!req.isDone()guard inside the EDT runnable to prevent duplicate terminal actions when multiple callbacks race.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
b26f66c to
e814443CompareUh oh!
There was an error while loading. Please reload this page.
Motivation
AsyncResourcecompletion, error and cancel handlers are executed on the UI thread to avoid threading issues.isDone.Description
req.complete,req.error, andreq.cancelcalls inDisplay.getInstance().callSerially(...)inInternalCallbackso they run on the EDT.!req.isDone()guard and add an inner!req.isDone()check inside the runnable to avoid duplicate terminal actions.requestSuccess,requestError,requestKeyRevokedError, andrequestCompletemethods.Testing
Codex Task