Skip to content

perf: cache app resolution#466

Merged
thymikee merged 1 commit intomainfrom
perf/app-resolution-cache
Apr 28, 2026
Merged

perf: cache app resolution#466
thymikee merged 1 commit intomainfrom
perf/app-resolution-cache

Conversation

@thymikee
Copy link
Copy Markdown
Contributor

Summary

Cache successful human-readable app resolution for Android, iOS, and macOS with short-lived per-device keys.

Bypass cache for exact package/bundle IDs and clear app-resolution caches around install/uninstall/reinstall flows so stale inventory-derived IDs are not retained.

Extract shared TTL cache mechanics and add platform tests for cache reuse, exact ID bypass, and install invalidation.

Touched files: 6. Scope stayed within platform app resolution and tests.

Validation

  • pnpm format
  • pnpm vitest run src/platforms/android/tests/index.test.ts src/platforms/ios/tests/index.test.ts
  • pnpm check:quick
  • pnpm vitest run --testTimeout=120000
  • pnpm test:smoke

Known local gap: pnpm check:unit was attempted, but the full default Vitest run repeatedly timed out src/tests/client-metro-packaged.test.ts in this environment with status null. That exact test passed when run alone, and the full Vitest suite passed with --testTimeout=120000.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 28, 2026

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://callstackincubator.github.io/agent-device/pr-preview/pr-466/

Built to branch gh-pages at 2026-04-28 21:05 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d8c198a39c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/platforms/ios/apps.ts Outdated
let cachedSimctlPrivacyServicesCacheKey: string | undefined;

function buildIosAppResolutionCacheKey(device: DeviceInfo, target: string): string {
return ['ios', device.id, device.kind, target.trim().toLowerCase()].join('\0');
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Include simulator set path in iOS resolution cache key

resolveIosApp now caches display-name lookups by device.id/kind, but simulator app inventory is actually scoped by device.simulatorSetPath via runSimctl (--set ...). Because the cache key omits that set path, two sessions targeting different simulator sets can reuse a stale bundle mapping for up to 30s when IDs overlap (a supported multi-tenant pattern in this repo), causing open/close/uninstall to act on the wrong bundle without re-querying listapps.

Useful? React with 👍 / 👎.

@thymikee thymikee force-pushed the perf/app-resolution-cache branch 3 times, most recently from be85970 to 3ebb342 Compare April 28, 2026 21:02
@thymikee thymikee force-pushed the perf/app-resolution-cache branch from 3ebb342 to a0b9611 Compare April 28, 2026 21:04
@thymikee thymikee merged commit 2c73e39 into main Apr 28, 2026
18 checks passed
@thymikee thymikee deleted the perf/app-resolution-cache branch April 28, 2026 21:06
@thymikee thymikee linked an issue Apr 28, 2026 that may be closed by this pull request
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.

perf: cache app and package name resolution

1 participant