Repository navigation
Conversation
There was a problem hiding this comment.
1 issue found across 14 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/platform-harmonyos/src/runtime.test.ts">
<violation number="1" location="packages/platform-harmonyos/src/runtime.test.ts:454">
P3: This test leaves Vitest fake timers installed after it finishes. Restore real timers in cleanup (as `packages/platform-harmonyos/src/__tests__/app-lifecycle.test.ts` does), otherwise teardown or any additional tests in this worker can observe mocked `Date` and timer APIs.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
| }); | ||
|
|
||
| test('openApplication fails when --foreground demands the foreground and the launch never surfaces', async () => { | ||
| vi.useFakeTimers(); |
There was a problem hiding this comment.
P3: This test leaves Vitest fake timers installed after it finishes. Restore real timers in cleanup (as packages/platform-harmonyos/src/__tests__/app-lifecycle.test.ts does), otherwise teardown or any additional tests in this worker can observe mocked Date and timer APIs.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At packages/platform-harmonyos/src/runtime.test.ts, line 454:
<comment>This test leaves Vitest fake timers installed after it finishes. Restore real timers in cleanup (as `packages/platform-harmonyos/src/__tests__/app-lifecycle.test.ts` does), otherwise teardown or any additional tests in this worker can observe mocked `Date` and timer APIs.</comment>
<file context>
@@ -362,3 +363,137 @@ function gestureHost(): PlatformRuntimeHost {
+});
+
+test('openApplication fails when --foreground demands the foreground and the launch never surfaces', async () => {
+ vi.useFakeTimers();
+ launchDumpHdc();
+ const hdc = vi.mocked(runHarmonyShell);
</file context>
|
Thanks for this. At 45a07a8 the change needs a live HarmonyOS run before it can merge, and two open review threads still need fixes. All 13 checks pass, but no CI lane runs a HarmonyOS device or HDC, so green CI proves only the mocked unit tests and gates. No conflicts. This changes the HarmonyOS open lifecycle on a real device, and the PR has no live run (app-lifecycle.ts#L287). The whole fix assumes that on a locked screen On the open threads: the P1 thread on a failed read becoming "not foreground" still stands (#4293 (comment), any hdc failure becomes unconfirmed). The P2 thread on the 5s budget still stands (#4293 (comment), worst case about 10.5s). So do the test helper thread (#4293 (comment)) and the fake-timers thread (#4293 (comment)). The thread on inherited-app reopen (#4293 (comment)) does not apply today: that path fails at Could one typed verdict replace the boolean that is only ever false? For example Not blocking, and fine to take or leave: pollHarmonyOpenForeground compares the bundle only with the first FOREGROUND mission, so split-screen or floating windows on tablets and foldables could report unconfirmed (confirm when any FOREGROUND mission names the bundle, and include a multi-window dump in the run or call it out of scope); openNotForegroundWarning in session-open-execution.ts hard-codes 'HarmonyOS' and the leaf's 5s budget in daemon text; OpenForegroundVerification.confirmed in application-lifecycle-runtime.ts is never true, and the daemon test helper has an unused onOpenApplication parameter; readHarmonyForegroundMission repeats the read in readHarmonyAppState, differing only in timeout and in returning undefined; and the PR body says 10 files (the diff has 14), spells the reason open_not_foreground (the code uses open-not-foreground), links no issue, and lists no device run or open risk. I could not check what Before merge, please post the live run at 45a07a8, then fix the probe-failure and budget threads. |
There was a problem hiding this comment.
1 issue found across 1 file (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="docs/evidence/harmonyos-open-foreground-2026-11-08.md">
<violation number="1" location="docs/evidence/harmonyos-open-foreground-2026-11-08.md:60">
P3: This evidence record misstates the validation result: `app-lifecycle.test.ts` contains 24 tests, not 89. Replace the count with the actual number or record the command and suite that produced 89 so the live-run evidence remains independently verifiable.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
|
|
||
| ## Suite | ||
|
|
||
| `packages/platform-harmonyos/src/__tests__/app-lifecycle.test.ts`: 89 tests |
There was a problem hiding this comment.
P3: This evidence record misstates the validation result: app-lifecycle.test.ts contains 24 tests, not 89. Replace the count with the actual number or record the command and suite that produced 89 so the live-run evidence remains independently verifiable.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At docs/evidence/harmonyos-open-foreground-2026-11-08.md, line 60:
<comment>This evidence record misstates the validation result: `app-lifecycle.test.ts` contains 24 tests, not 89. Replace the count with the actual number or record the command and suite that produced 89 so the live-run evidence remains independently verifiable.</comment>
<file context>
@@ -0,0 +1,61 @@
+
+## Suite
+
+`packages/platform-harmonyos/src/__tests__/app-lifecycle.test.ts`: 89 tests
+pass on this branch's build (typecheck and lint clean).
</file context>
| `packages/platform-harmonyos/src/__tests__/app-lifecycle.test.ts`: 89 tests | |
| `packages/platform-harmonyos/src/__tests__/app-lifecycle.test.ts`: 24 tests |
|
Evidence committed to the branch: 🤖 Generated with Claude Code |
|
I reviewed 99e4622 against the earlier findings, and one evidence gap from that review is still open. All 13 checks pass, but no CI lane runs a HarmonyOS device or HDC, so green covers only mocked tests and gates, not the changed device route. I did not run the tests, and I had no HarmonyOS device. I judged the tests by reading the diff and test bodies. The evidence file still records only the unlocked positive route: an elided The rule the code must satisfy is that On the open inline threads: the comments on all-failed probe reads becoming Before merge, please commit the locked plain, locked |
|
This branch now conflicts with main. Please rebase and address the outstanding review findings in the same push. I will review the updated head. |
… dispatches `aa start` reports an accepted launch, not a visible app, so an open under a lock screen succeeded beside an invisible app and only a later snapshot told the truth. HarmonyOS now polls its foreground read for up to 5s after the dispatch. A launch that never surfaced carries a typed `timing.foregroundVerification` fact and the open warns `open-not-foreground` with the app that held the foreground; `open --foreground` fails with `details.reason: open-not-foreground` instead. Co-Authored-By: Claude Code <noreply@anthropic.com>
Review follow-ups on the foreground verification. The versioned help now states the HarmonyOS side of `--foreground` beside its iOS snapshot semantics, in the flag declaration and in the open command detail that owns the open reasons. The open-not-foreground warning reads as a sentence for both its holder and unreadable-foreground arms, and the patch carries a changeset. Co-Authored-By: Claude Code <noreply@anthropic.com>
…ion list Co-Authored-By: Claude Code <noreply@anthropic.com>
…stayed backgrounded The poll bounds each read by the budget's remainder, tracks whether any read parsed a foreground mission at all, and marks a budget with zero parseable reads as an unreadable probe. The verify carries that as its own typed reason (open-foreground-probe-unreadable) instead of open-not-foreground, the daemon warning says the read claims nothing about the foreground, and the route tests pin the --foreground hard failure and the unreadable warning. Co-Authored-By: Claude Code <noreply@anthropic.com>
99e4622 to
70bfed4
Compare
|
Rebased onto current main (the commands.md conflict keeps main's close/relaunch notes beside this branch's HarmonyOS open line), and all three outstanding findings are fixed at 70bfed4. A failed probe is no longer a backgrounded verdict (r4497023199). The poll tracks whether any read parsed a foreground mission at all: each read is bounded by the budget's remainder (both the --foreground contract pinned (r4497023212). The route test passes Budget overrun (r4497023234). The remaining-time check now runs before each read, and both the read timeout and the sleep clamp to that remainder. The thread on URL positionals is resolved as you marked it. 122 platform and 230 lifecycle tests, typecheck, lint, and fallow pass at the pushed head. |
|
I reviewed 70bfed4 after the earlier conflict notice (#4293 (comment)). A failed foreground read no longer reports open-not-foreground, and the poll now clamps each read and sleep to the 5s budget. The new classification has one wrong case, and the help and live evidence do not match it yet. All 16 checks pass at this commit, and there are no conflicts. A successful The new reason The only live run in the evidence record is the confirmed path, and it predates this change. Once the classification is fixed, please attach a live HarmonyOS run at the PR head. With the keyguard up, plain Not blocking, and fine to take or leave: the Could one fact simplify this? The platform owner could return only when unconfirmed On the open threads: the Before merge, the lock-screen classification needs the fix above, then the help and docs need both reasons, and then the live keyguard run needs attaching. |
Summary
On HarmonyOS,
openreported success off thestart ability successfullystdout line alone — on a locked screen the report said Opened while the screen showed the lock face, and the session kept reasoning from a state the device never entered.openHarmonyAppnow polls the app state (up to 5s, reusing the FOREGROUND parsing fromapps state) after the launch line: when the launched bundle does not hold the foreground, the result carries anopen_not_foregroundwarning telling the caller to unlock first;--foregroundmode escalates that to a hard failure.10 files changed (app-lifecycle polling, result plumbing, tests).
Validation
pnpm run typecheck,pnpm run lint, app-lifecycle tests, integration-progress--check, fallow, freerange: pass locally.🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.