fix(native): fix widget image management and add tests

- Fix `copyBundledAsset` to accept a URI instead of a named bundle asset, resolving via `resolveAssetURL` with support for remote downloads
- Read app group identifier from Info.plist (`ExpoWidgetsAppGroupIdentifier`) instead of a hardcoded string
- Add `pruneWidgetImages(maxAgeSeconds)` to age-based cache cleanup, skipping the widget icon file
- Add `normalizedFileName` helper to sanitize cache keys and a `log` helper with consistent prefix
- Extract `getWidgetIconAsset()` into `widget-assets.ts` so the asset require is testable in isolation
- Add Vitest config for the native app and unit tests covering widget data-fetch, image download, and prune logic
This commit is contained in:
2026-03-24 11:13:09 -04:00
parent 1bf12d3884
commit 34b9ae3620
12 changed files with 522 additions and 102 deletions
+10 -5
View File
@@ -12,11 +12,12 @@ on:
jobs:
claude-review:
# Optional: Filter by PR author
# if: |
# github.event.pull_request.user.login == 'external-contributor' ||
# github.event.pull_request.user.login == 'new-developer' ||
# github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
# Skip for bot PRs and fork PRs due to OIDC token limitations in pull_request_target
# Fork PRs fail because the actor in OIDC context is the fork contributor (read-only)
if: |
github.event.pull_request.draft == false &&
github.event.pull_request.user.type != 'Bot' &&
github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
permissions:
@@ -41,3 +42,7 @@ jobs:
prompt: "/code-review:code-review ${{ github.repository }}/pull/${{ github.event.pull_request.number }}"
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
# or https://code.claude.com/docs/en/cli-reference for available options
track_progress: true
claude_args: |
--model 'claude-opus-4-6'
--allowedTools 'mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*)'
+1 -1
View File
@@ -46,4 +46,4 @@ jobs:
# Optional: Add claude_args to customize behavior and configuration
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
# or https://code.claude.com/docs/en/cli-reference for available options
# claude_args: '--allowed-tools Bash(gh pr:*)'
claude_args: "--model claude-opus-4-6"