Repository navigation
refactor(app): why Aleph refused a backup, as data (BK1) - #1075
Merged
Merged
Conversation
A headless module, backup/core/refusal.js: a refusal's code, whether asking again can work, Aleph's own code and the amounts when it named them – read from a thrown error, a row of the history, or Aleph's code alone. The run's words for a refusal, the row it writes and the card's "the file is gone" read it; texts and test ids are as before. backup/core/ is the first folder of logic that runs without the page: a lint rule keeps Svelte, SvelteKit, the session, the catalogue and the browser's globals out of it. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
18 tasks
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.
First step of #1074 (BK1). No visible change: texts and
data-testids are as before.What
app/src/lib/backup/core/refusal.js(new, headless): a refusal as plain data –{ code, retry, alephCode?, credits?, required? }withcodeone ofcredits | file-unavailable | not-allowed | invalid | unknownandretryone ofno | after-credits | after-grant | maybe. Three ways in:refusalOfError(thrown by the browser key's path or reported by the bridge),refusalOfRecord(a row of the history),refusalOfCode(Aleph's code alone). The codes follow pyaleph'sErrorCodelist; one it does not list staysunknown.run.svelte.js: the words for a refusal, "was it a refusal", and theerrorCodewritten to the row read the module.BackupCard.svelte: "the file is gone, no retry" readsrefusalOfRecord(b)?.code === 'file-unavailable'instead of comparing with4;FILE_NOT_FOUNDleaveskeeper.js.eslint.config.js:src/lib/**/core/is headless – no Svelte, SvelteKit, session, catalogue or browser globals.Not in here
The row still shows no reason and still offers a retry for every code but 4: that is #1067, a visible change with its own PR on top of this.
One edge differs: a refusal for credits in which Aleph names an amount that is no number now reads as the general refusal text instead of showing "NaN".
Tests
core/refusal.spec.js(node, no browser): one case per way a refusal arrives, known and unknown codes, rows Aleph did not refuse.vitest --run src/lib/backup(99 passed, 1 skipped),pnpm check,pnpm lint,e2e/backup.spec.js(covers the retry and the refusal afterpending). The rest of the E2E suite is left to CI.🤖 Generated with Claude Code