Skip to content

fix(harmonyos): refresh sidebar sessions without loading flicker - #2991

Merged
bobleer merged 1 commit into
GCWing:mainfrom
guantw:fix/harmonyos-sidebar-session-refresh
Sep 12, 2026
Merged

fix(harmonyos): refresh sidebar sessions without loading flicker#2991
bobleer merged 1 commit into
GCWing:mainfrom
guantw:fix/harmonyos-sidebar-session-refresh

Conversation

@guantw

@guantw guantw commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Refresh HarmonyOS sidebar session lists when the sidebar opens or is restored and when the user presses the refresh button. Cached lists, including previously loaded empty lists, refresh without a loading row. Workspace expansion retains its existing lazy-loading behavior.

Type and Areas

Type: Bug fix

Areas: Native HarmonyOS controller, sidebar/session state, focused regression tests.

Motivation / Impact

After the phone loaded a workspace, a session created on Desktop could remain absent from the phone's sidebar. Cached rows prevented another list request, and the refresh button only updated device presence.

The sidebar now refreshes the selected online device's disclosed workspaces, retaining cached rows, selection, and disclosure state. Current-workspace results also update the session controller. Requests are coalesced, and stale account, connection, refresh, or pagination responses cannot overwrite newer snapshots.

Verification

  • node scripts/check-harmonyos-architecture.mjs: passed.
  • git diff --check: passed.
  • node scripts/check-git-object-sizes.mjs --base origin/main --head HEAD: passed for all 12 changed blobs.
  • Focused host execution of DeviceDirectoryUnit.test.ets and the RemoteSessionController suite in RemoteControllersUnit.test.ets: 40/40 passed using a temporary harness with platform APIs mocked. The real list implementations and checked-in test bodies were executed.
  • hvigorw --mode module -p product=default -p module=entry@default assembleHap --no-daemon: passed in WSL with the installed HarmonyOS toolchain. Verified build inputs, HAP ZIP integrity, ArkTS bytecode, AArch64 library, and Windows handoff SHA-256.
  • Debug-signed HAP installed on a connected physical HarmonyOS phone. Independently verified the signature and installed bundle information.
  • hvigorw --mode module -p module=entry@default -p ohos.test.type=LocalTest test --no-daemon: the SDK runner stalled at its Linux execution stage; this is not counted as a passing native test run.

Reviewer Notes

  • AI-assisted; testing level: lightly tested (focused logic, native build, and installation).
  • Compact and wide sidebar entry points share the refresh owner. Interactive before/after UI checks and screenshots have not been captured.
  • Remote-control session listing was exercised with simulated sources. Live remote workspace, Peer Device Mode, and Detached Dispatch scenarios have not been exercised.
  • The loaded-list marker is in-memory state; no persisted data or wire format migration is required.

Checklist

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above, or skipped checks are explained.
  • User-facing strings, docs, and locales are updated where applicable. No new copy is introduced.

Refresh disclosed workspace session lists when opening or restoring the
sidebar and when refreshing devices, while preserving lazy workspace loading.
Keep cached lists and previously loaded empty lists visible during refresh.

Scope in-flight requests to their account, device, and connection generation.
Publish current-workspace snapshots through the session controller and prevent
older refresh or pagination responses from replacing newer lists.

Add regression coverage for cache retention, empty results, concurrent refresh
coalescing, and stale account, connection, and session-list responses.
@bobleer
bobleer merged commit ab61f89 into GCWing:main Sep 12, 2026
9 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.

2 participants