Upload Bundle can send a bundle built before the latest playground edits
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 78/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- react, typescript
Direzione di ricerca
Start with UploadBundleDialog.tsx to trace how the current bundle is selected, then read Viewer.tsx to understand when files are rebuilt. Add the files-hash comparison and test it in apps/playground/src/utils/__tests__/file.test.ts; the issue also specifies an E2E test in testing/src/specs/playground.spec.ts. Done means an immediate upload after editing posts a bundle containing the latest title, with the helper test passing.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Upload Bundle can send an ODC instance a bundle built before the user's latest edits, and report success. UploadBundleDialog uploads transpilerState.bundle whenever the state is built. The Viewer rebuilds only on its polling tick, every settings.refreshInterval milliseconds (2000 by default, and user-configurable in User Settings). The built state does not record which files it was built from. So between an edit and the next tick, the state is still built from the previous files, and an upload in that window posts the old code. The dialog says nothing about this. With a longer refresh interval, the window is that long.
Where
apps/playground/src/components/Header/ActionsDropdown/UploadBundleDialog.tsx:57-92:
const handleSubmit = async () => {
const state = transpilerStateRef.current;
if (editorErrors.length > 0) {
// ...
} else if (state.status === 'building' || state.status === 'initial') {
// ...
}
// ...
const bundle = state.bundle;
apps/playground/src/components/Viewer/Viewer.tsx:64-73:
useInterval(() => {
const currentFiles = editorFilesRef.current;
hashFiles(currentFiles)
.then((currentHash) => {
if (currentHash !== filesHash) {
void transpile(currentFiles);
}
})
.catch(console.error);
}, refreshInterval);
Reproduce
- Log in to an instance through the actions menu, then set Refresh Interval to
30000in User Settings. - Change
details.titleinindex.ts. - Within 30 seconds, open the actions menu, choose Upload Bundle and click Upload.
Actual: the instance stores the instrument with the old title, and the playground shows a success notification.
Expected: the upload uses a bundle built from the files currently in the editor, either by building them first or by refusing with a "build in progress" message.
Tests
Store the files hash on the built state and add a pure helper that compares it with the current files. Test the helper in apps/playground/src/utils/__tests__/file.test.ts: it('should treat a bundle built from other files as stale, so an upload never sends code older than the editor').
E2E in testing/src/specs/playground.spec.ts: intercept POST **/v1/instruments with page.route, edit the title, upload straight away, and assert that the posted bundle contains the new title.
Suggested fix
Record the files hash in the built state ({ status: 'built', bundle, filesHash }). In handleSubmit, hash useAppStore.getState().files, and if it differs from filesHash, build those files and upload the result (or refuse with a message).
- Lingua principale
- TypeScript
- Stelle
- 119
- Fork
- 19
- Merge medio
- 5g 10h
- PR unite (30g)
- 36
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di DouglasNeuroInformatics/OpenDataCapture
-
Area: Infrastructure Chore Difficulty: Low Priority: Medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
DouglasNeuroInformatics/OpenDataCapture#1835 ·
I maintainer di solito rispondono entro 2 giorni
-
Interactive With JSPsych example submits a DataCollection its own schema rejectsForse già presa @Sanilas-ai l’ha presa 3 giorni fa. ApertaArea: Playground Bug Difficulty: Low Good First Issue Priority: Medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
DouglasNeuroInformatics/OpenDataCapture#1833 ·
I maintainer di solito rispondono entro 2 giorni
-
Area: Instruments Bug Difficulty: Low Priority: Low
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
DouglasNeuroInformatics/OpenDataCapture#1824 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Area: Shared Bug Difficulty: Low Priority: Low
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
DouglasNeuroInformatics/OpenDataCapture#1813 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Multiple instructions show as one comma-joined paragraph ("questions., Conditional")Forse già presa @Sanilas-ai l’ha presa 3 giorni fa. ApertaArea: Shared Bug Difficulty: Low Good First Issue Priority: Low
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
DouglasNeuroInformatics/OpenDataCapture#1812 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di DouglasNeuroInformatics/OpenDataCapture
Issue simili
-
mobile-app
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
Open-Locker/Open-Locker#352 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
leanprover-community/lean4game#589 ·
I maintainer di solito rispondono entro 2 giorni
-
Add: CS Action BGApertacheck:passed streams:add
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
unocss/unocss#5421 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno