Repository navigation
V48: a damaged share link ends on a refusal, never on a crash - #109
Merged
Merged
Conversation
Measured on three real links captured from the app: deleting, nulling or retyping single fields gave 3660 links the decoder accepted, and 1020 of them crashed the page on 99 distinct paths. Rather than a 99-path schema that drifts with every new analysis, SharedRunPage now wraps the run in a render guard that shows the refusal page with its own explanation. - tests/share-links: the three real payloads, decoded - SharedRunPage.test: every field shape damaged six ways must end on the run or the refusal (fails before this change) - src/lib/download: one download helper instead of five copies, revoking the object URL after the click is handled - PLAN/CHANGELOG: V48 delivered, version 1.48.0 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ELAjHYDyxa5zbbdcke1bMA
There was a problem hiding this comment.
🟢 Approval recommended
The render guard, regression coverage, download refactor, documentation, and generated version files are consistent and show no unresolved defects.
0 open findings
What changed in this PR
Adds graceful refusal handling for malformed share links and centralizes browser downloads.
Changes:
- Adds a render guard and comprehensive damaged-payload regression coverage.
- Consolidates download behavior with delayed object-URL cleanup.
- Adds fixtures, translations, documentation, and V48 version updates.
| File | Description |
|---|---|
tests/share-links/titanic.json |
Binary-run fixture. |
tests/share-links/iris.json |
Multiclass-run fixture. |
tests/share-links/mpg.json |
Regression-run fixture. |
tests/share-links/README.md |
Documents fixtures and regeneration. |
src/locales/en.json |
Adds English refusal explanation. |
src/locales/fr.json |
Adds French refusal explanation. |
src/lib/download.ts |
Introduces shared download helper. |
src/lib/download.test.ts |
Tests delayed URL revocation. |
src/features/ml/pages/SharedRunPage.tsx |
Guards shared-run rendering failures. |
src/features/ml/pages/SharedRunPage.test.tsx |
Exercises damaged share payloads. |
src/features/ml/components/ImportModelPanel.tsx |
Uses shared download helper. |
src/features/ml/components/ExportBar.tsx |
Uses shared download helper. |
src/features/ml/components/BatchScorePanel.tsx |
Uses shared download helper. |
src/features/data/SqlPanel.tsx |
Uses shared download helper. |
src/features/data/components/DataExportBar.tsx |
Uses shared download helper. |
README.md |
Updates unit-test count. |
PLAN.md |
Marks V48 delivered. |
package.json |
Bumps version to 1.48.0. |
package-lock.json |
Synchronizes package version. |
docs/superpowers/plans/2026-10-09-v48-share-links.md |
Records V48 design decisions. |
CHANGELOG.md |
Adds the generated V48 entry. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Summary
The roadmap row for V48 planned a deeper validator for share links. I measured first, and the numbers changed the approach.
Measurement. I captured three real share links from the running app:
I then deleted, nulled, or retyped every field of each one and rendered the result through the real
SharedRunPage:A validator covering 99 paths would become the largest file in the module, and it would drift every time a run learns to carry a new analysis.
Change
SharedRunPagenow wraps the run in a render guard. Any failure while drawing the run shows the refusal page, with its own FR/EN explanation, and nothing from the run. A partial render was rejected on purpose: it would let a half-read figure pass for a real one.tests/share-links/, with a README.SharedRunPage.test.tsx. Each field shape is damaged six ways, and the page must end on either the run or the refusal. The test fails on the code before this change.src/lib/download.ts. It revokes the object URL after the click has been handled instead of in the same tick, where some browser engines cancel the download without any error.docs/superpowers/plans/.Cost. The regression test adds about 25 s to the unit suite: 66 s → 90 s on 4 cores. I chose to cover the whole format instead of a sample.
Test plan
lint,format:check,typecheck,buildnpm test: 889 passed. Before the guard, the new share-page test fails 2 of its 5 cases.🤖 Generated with Claude Code
https://claude.ai/code/session_01ELAjHYDyxa5zbbdcke1bMA
Generated by Claude Code