fix(MILAB-5944): tsv from remote fails - #38
Conversation
Replace lsDriver.getLocalFileContent() with the ReactiveFileContent pattern used by samples-and-data. A new prerun template imports the file via file.importFile() and exports it as a blob; the model exposes it via ctx.prerun.getFileHandle(); the UI uses ReactiveFileContent (blobDriver) to read bytes reactively and detect columns. This makes column detection work for files from remote Platforma storages, not just locally-mounted ones.
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical limitation in assay file import, where files stored in remote Platforma storages were not correctly processed due to reliance on local file system access. By introducing a prerun workflow that imports the selected file and exposes it as a blob, and then leveraging a reactive file content pattern in the UI, the system can now uniformly handle assay files from both local and remote sources. This change significantly enhances the usability and robustness of the assay file import functionality, providing a more consistent user experience. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request effectively refactors the assay file import process to support remote storage, which is a significant improvement. The approach of using a prerun workflow and ReactiveFileContent is solid. I've included a couple of suggestions in ui/src/pages/MainPage.vue to enhance code maintainability and clarity.
retentiveOutput keeps the old assayFileHandle after fileHandle is cleared, so assayFileBytes never updates and importColumns stays undefined. Return [] instead of undefined from sequenceColumnOptions and otherColumnOptions when no file is selected, so the dropdowns show empty rather than a loading spinner.
Local (upload://) files now read directly from disk via getLocalFileContent() for immediate column detection — same as the original behaviour, no prerun round-trip needed. Remote (index://) files continue to use the assayFileBytes watch once the prerun completes. A guard prevents double-processing if both paths fire.
|
|
||
| /** | ||
| * Process FASTA file and convert to table format | ||
| */ |
There was a problem hiding this comment.
This function combined file I/O (lsDriver.getLocalFileContent) with FASTA parsing in one place, which made it impossible to reuse for remote files. The logic has been split:
- I/O moved into
setFileinMainPage.vue: local files (upload://) are read immediately vialsDriver.getLocalFileContent(); remote files (index://) arrive later as bytes from the prerun blob viaReactiveFileContent. - Parsing (
parseFastaContent→fastaToTable→ split intorawData) is now inlined inprocessFileBytesinimportFile.ts, which receivesUint8Arraybytes regardless of where they came from.
parseFastaContent and fastaToTable remain in this file unchanged.
Switch assayFileHandle from retentiveOutput to output, unify local/remote
file handling through a single watch with { immediate: true }, and simplify
setFile to a synchronous function — removing the local-file fast-path that
bypassed the prerun.
Re-introduce the two-path approach for reading file bytes: - Local (upload://) files: read directly via lsDriver — immediate, no prerun round-trip - Remote (index://) files: watch assayFileBytes once the prerun imports the file ReactiveFileContent cannot resolve bytes from the prerun output handle for local files, causing processFileBytes to never be called and the 'No sequence columns found' error to silently disappear.
Summary
file.exportFile()ctx.prerun?.resolveAny({ field: 'assayFile' })?.getFileHandle()upload://) files: read bytes directly vialsDriver.getLocalFileContent()— immediate, no prerun round-trip neededindex://) files:ReactiveFileContentreads bytes reactively viaassayFileHandleonce the prerun completes — works for storages not locally mounted[]vsundefinedwhen no file is selected)assayFileHandleoutput: changed fromretentiveOutputtooutputso stale handles don't block reactivity when the file changesWhy
lsDriver.getLocalFileContent()throws"Storage X is not mounted locally"for files from remote Platforma storages. The call was also unawaited, so the error was silently swallowed — the block appeared to accept the file but column detection never ran, leaving it permanently unconfigurable.ReactiveFileContentcannot resolve bytes from the prerun output handle for local files (causes the column detection to spin forever), so the two-path approach is necessary — local files bypass the prerun for byte reading, remote files go through it.Test plan
Video shows:
Screen.Recording.2026-03-17.at.11.19.30.AM.mov