Repository navigation
The timetable dialog says when a chosen file cannot be read - #662
Merged
Merged
Conversation
A rejected file.text() is caught and shown with the data import wizard's own message (import.fileReadFailed), cleared by the next text typed or read; no unhandled rejection is left on the page. Part of #615.
Deploying cozy-loop-studio with
|
| Latest commit: |
cf0840b
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://3a3ff726.cozy-loop-studio.pages.dev |
| Branch Preview URL: | https://timetable-file-read-failed.cozy-loop-studio.pages.dev |
This was referenced Nov 24, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Part of #615 (item 5, part B: the timetable dialog's file read; part A was #661. With this PR merged, #615's item 5 is complete).
What was wrong
In Data ▸ New timetable…, a CSV chosen with the file input is read with
await file.text(), with no catch (TimetableImportDialog.tsx,pickFile). Measured on main64c1fea1(scratchreproduction), with this page's file read made to fail:The dialog stays usable: pasting the contents by hand works. The data import wizard already handles the same case with a message (#423).
The change (
src/components/dataImport/TimetableImportDialog.tsx)import.fileReadFailed: "The file could not be read. Try choosing it again, or paste its contents instead." It is shown as an alert under the file field.Tests (
e2e/timetable-file-read.spec.ts, new, written first)File.prototype.textrejects): the dialog's alert reads the message; no page error; the text box is empty; pasting the contents by hand gives "Rows read: 2" and clears the message, still with no page errorChecks
npx tsc -b: clean.npm run lint: 88 warnings, the baseline.check:*scripts: pass.What it touches