Skip to content

fix: backport device capability tiers for v6.5.0#12475

Merged
originalix merged 8 commits into
release/v6.5.0from
codex/hotfix-device-performance-tier-v650
Jul 17, 2026
Merged

fix: backport device capability tiers for v6.5.0#12475
originalix merged 8 commits into
release/v6.5.0from
codex/hotfix-device-performance-tier-v650

Conversation

@huhuanming

Copy link
Copy Markdown
Contributor

Summary

  • Backport CPU and memory capability profiles plus capability-aware Tab preload policies to release/v6.5.0.
  • Keep the change hot-update compatible by excluding all Electron main/preload and Desktop API contract changes.
  • Make Desktop renderer use the same browser capability inputs as Web: navigator.hardwareConcurrency and navigator.deviceMemory when available.

Intent & Context

PR #12454 targets x and includes changes under apps/desktop/app/libs, which cannot be delivered through the release/v6.5.0 hot-update path. This PR carries the JS capability classification and preload policy to the release branch without requiring a new Desktop binary.

Root Cause

The exact Desktop capability implementation in PR #12454 depends on Electron main/preload bridge changes. Those source changes are outside the hot-update bundle, so merging them into the release hot-update PR would create a native/binary dependency that the installed v6.5.0 Desktop application does not have.

Design Decisions

  • Excluded every apps/desktop/** change, Desktop-specific capability override, and Desktop API type change from the backport.
  • Relied on the existing Desktop renderer resolution order (.desktop.web → generic) so the generic browser implementation is selected when no capability .desktop.ts file exists.
  • Kept CPU and memory independent, with conservative behavior: unknown memory never enables full Tab preloading.
  • Kept capability results cached per JS runtime/context. Native main and bg have separate JS heaps and initialize independently; the Tab preload policy is consumed by main only.

Changes Detail

  • Add Android/iOS CPU tier catalogs and native capability profile resolution.
  • Add browser CPU/memory classification for Web, Extension, and Desktop renderer.
  • Add capability-aware full/light/disabled Tab preload policies and sanitized decision logging.
  • Add versioned developer CPU overrides and regression coverage for audited device tiers, unknown memory, caching, and prototype-safe catalog lookups.

Risk Assessment

  • Risk Level: Medium
  • Affected Platforms: Mobile, Web, Extension, Desktop renderer
  • Risk Areas: Device catalog accuracy, conservative fallback behavior, and Tab preload queue selection
  • Excluded: Electron main process, preload bridge, Desktop native/API contracts

Test plan

  • yarn jest packages/kit/src/routes/Tab/preloadPolicy.native.test.ts packages/kit/src/routes/Tab/preloadPolicy.test.ts packages/kit/src/routes/Tab/preloadPolicyResolver.test.ts packages/shared/src/performance/deviceCpuTierData.test.ts packages/shared/src/performance/deviceCpuTierUtils.test.ts packages/shared/src/performance/devicePerformanceTier.native.test.ts packages/shared/src/performance/devicePerformanceTier.test.ts packages/shared/src/performance/devicePerformanceTierResolver.test.ts --runInBand (8 suites, 49 tests)
  • yarn app:web:build
  • yarn app:ext:build
  • yarn workspace @onekeyhq/desktop build:renderer
  • yarn agent:check --profile commit
  • Confirm the PR diff contains no apps/desktop/**, capability .desktop.ts, or Desktop API contract changes

Comment thread packages/kit/src/routes/Tab/preloadPolicy.ts
@huhuanming huhuanming changed the title fix: backport device capability tiers for v6.5.0 hot update fix: backport device capability tiers for v6.5.0 Jul 14, 2026
@huhuanming
huhuanming enabled auto-merge (squash) July 14, 2026 14:33
Comment thread packages/kit-bg/src/services/ServiceAccount/ServiceAccount.ts
@huhuanming huhuanming added the release-ready This PR should be included in the next release label Jul 16, 2026
@huhuanming
huhuanming requested a review from originalix July 16, 2026 12:41
@originalix
originalix disabled auto-merge July 17, 2026 02:14
@originalix
originalix merged commit 54a93b6 into release/v6.5.0 Jul 17, 2026
16 checks passed
@originalix
originalix deleted the codex/hotfix-device-performance-tier-v650 branch July 17, 2026 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-ready This PR should be included in the next release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants