-
Notifications
You must be signed in to change notification settings - Fork 85
QVAC-18481 test[skiplog]: pre-load multi-file model companion sets on bootstrap #1899
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b4ebcfe
test: pre-load multi-file model companion sets on bootstrap
Victor-Rodzko 48c86a9
test: extract shared resolveBundledAssetUri helper
Victor-Rodzko 72380e0
chore: clean stale @qvac/sdk snapshots before consumer install
Victor-Rodzko 3c69d6c
test: dispatch mobile TTS tests by metadata.dependency
Victor-Rodzko 911b138
Merge branch 'main' into test/preload-companion-sets
Victor-Rodzko 838965d
Merge branch 'main' into test/preload-companion-sets
Victor-Rodzko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| /** | ||
| * Resolve a bundled RN asset module to a real filesystem path. | ||
| * | ||
| * On Android release builds expo-asset pre-sets `downloaded=true` and | ||
| * `localUri` to a drawable resource name (e.g. `assets_images_cat`), | ||
| * bypassing the native downloadAsync() that copies the resource to a | ||
| * cache file. Resetting `downloaded=false` forces the native module to | ||
| * run and produce a real `file://` URI — which we strip + percent-decode | ||
| * because SDK native addons (whisper, FFmpeg, ONNX runtime) expect POSIX | ||
| * paths, not URIs. | ||
| */ | ||
| export async function resolveBundledAssetUri(assetModule: number): Promise<string> { | ||
| // @ts-ignore - expo-asset is a peer dependency available in mobile context | ||
| const { Asset } = await import("expo-asset"); | ||
| const asset = Asset.fromModule(assetModule); | ||
| asset.downloaded = false; | ||
| await asset.downloadAsync(); | ||
| const rawUri: string | undefined = asset.localUri ?? asset.uri; | ||
| if (!rawUri) { | ||
| throw new Error(`Failed to resolve asset: ${asset.name ?? "unknown"}`); | ||
| } | ||
| return decodeURIComponent(rawUri.replace(/^file:\/\//, "")); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.