Repository navigation
Lifecycle: fail on blocking start() in the simulator, hold pushes during blocking calls, onReady/onResume - #6361
shai-almog wants to merge 13 commits into
Conversation
…Ready/onResume The simulator runs init/start/stop/destroy with blocking disabled and a BlockingDisallowedException that names the callback. Pushes on every port go through PushDispatcher, which holds them while a blocking call is in progress on the EDT (at most 20s); Push.setDeliveryDeferred(false) restores direct delivery. Lifecycle gains onResume(Form) and onReady(boolean), which runs after start() returns and is where blocking startup work belongs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…y what was there Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… gates Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…actly Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cloudflare Preview
|
|
Compared 12 screenshots: 12 matched. |
|
Compared 380 screenshots: 380 matched. |
✅ Continuous Quality ReportTest & Coverage
Static Analysis
Generated automatically by the PR CI workflow. |
|
Compared 288 screenshots: 288 matched. Native Android coverage
✅ Native Android screenshot tests passed. Native Android coverage
Benchmark ResultsDetailed Performance Metrics
|
Native fidelity (Android, Material 3)54 pairs compared -- median 95.6%, worst 91.3% ( Distribution --
Geometry vs native (bbox offset / size ratio / center offset / corner radius) -- gated separately from the visual score
Side-by-side comparisons (worst first)
|
…contained Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # docs/demos/common/src/main/java/com/codenameone/developerguide/snippets/InputAndProgressSnippets.java
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Developer Guide build artifacts are available for download from this workflow run:
Developer Guide quality checks: |
✅ ByteCodeTranslator Quality ReportTest & Coverage
Benchmark Results
Static Analysis
Generated automatically by the PR CI workflow. |
|
Compared 286 screenshots: 286 matched. Benchmark Results
Build and Run Timing
Detailed Performance Metrics
|
|
Compared 303 screenshots: 303 matched. Benchmark ResultsDetailed Performance Metrics
ParparVM vs HotSpot (JDK 25): Windows x64Runner CPU: AMD64 Family 25 Model 17 Stepping 1, AuthenticAMD (baseline Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in
Result: no regression |
|
Compared 303 screenshots: 303 matched. Benchmark ResultsDetailed Performance Metrics
|
|
Compared 303 screenshots: 303 matched. Benchmark ResultsDetailed Performance Metrics
ParparVM vs HotSpot (JDK 25): Windows arm64Runner CPU: ARMv8 (64-bit) Family 8 Model D49 Revision 0, MICROSOFT CORPORATION (baseline Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in
Result: no regression |
|
Compared 303 screenshots: 303 matched. ParparVM vs HotSpot (JDK 25): Linux x64Runner CPU: Intel(R) Xeon(R) 6975P-C (baseline Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in
Result: no regression |
|
Compared 303 screenshots: 303 matched. ParparVM vs HotSpot (JDK 25): Linux arm64Runner CPU: Neoverse-N2 (baseline Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in
Result: no regression |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # docs/developer-guide/Backend-Security.asciidoc
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # docs/developer-guide/Design-Import.asciidoc
Native fidelity (ios-27-metal)68 pairs compared -- median 94.6%, worst 74.5% ( Distribution --
Geometry vs native (bbox offset / size ratio / center offset / corner radius) -- gated separately from the visual score
Side-by-side comparisons (worst first)
|
















































































































































































































































Apps that do blocking work in
start()crash intermittently on devices, and nothing catches it during development. The OS callsstart()on every launch and resume, including when a notification tap or another app (a provisioning flow, for example) brings the app forward. A modalDialog,invokeAndBlock()oraddToQueueAndWait()there keeps the EDT pumping, so a push can be delivered in the middle of startup code before the login form exists. Developers end up adding delays that only work sometimes.What changes
1. The simulator fails on blocking lifecycle code.
Executorrunsinit/startthrough the newDisplay.invokeWithoutBlocking(Runnable, String reason). A blocking call inside them (and so insiderunApp()/onResume()) throwsBlockingDisallowedExceptionwith a message naming the callback and pointing toLifecycle.onReady. On a cold start the simulator exits, as it already does for any exception thrown fromstart(). Devices are unchanged.stop/destroyrun off the EDT in the simulator, where nothing can be guarded, so the message and docs name onlyinit/start.2. Pushes wait for blocking calls (
com.codename1.impl.PushDispatcher). Every port's push delivery goes through it: iOS live push, AndroidPushNotificationServiceand pending pushes, the JS port (both envelopes), the simulator, and the legacyCodenameOneImplementation.pushReceived.invokeAndBlock(tracked inDisplay) or another push delivery is in progress is held. Held pushes are delivered in order once the outermost call returns, each with its own snapshot ofPushContent/pushType.Push.setDeliveryDeferred(false)turns the holding off and restores direct delivery.3.
LifecycleAPI.onResume(Form): the warm-start path, which re-shows the form by default.onReady(boolean firstLaunch): scheduled afterstart()returns, on launch and on every resume. Blocking startup work belongs here.runApp()is unchanged and still runs insidestart(), so existing subclasses that callsuper.start()see the same order.No builder changes, so cloud builds get all of this with nothing to change in the builder repo.
Compatibility
An app that blocks in
init/start/runAppnow fails in the simulator. This is deliberate: the same code races on devices. Every match in the tree's apps and samples is aDialog.showinside a listener lambda; none blocks in a lifecycle method.Known limits (commented in code)
flushEdt()is not counted as a blocking call outside a delivery. Counting it would push every held delivery past the next EDT turn.Verification
core-unittests: 9,744 tests pass. NewPushDispatcherTest(14 cases: hold/order, nesting, re-entry, failure, hold limit, content snapshot, opt-out, realinvokeAndBlock) andLifecycleTest.onReady) and Push Notifications.🤖 Generated with Claude Code