Skip to content

Handle errors in AsyncButton and WebView background tasks - #27

Open
Jeehut wants to merge 1 commit into
mainfrom
wip/task-error-handling
Open

Jeehut wants to merge 1 commit into
mainfrom
wip/task-error-handling

Conversation

@Jeehut

@Jeehut Jeehut commented Oct 28, 2026

Copy link
Copy Markdown
Member

Summary

Handle errors inside the three discarded throwing tasks in AsyncButton and WebView. This removes three NoUseUnstructuredThrowingTask diagnostics without changing public APIs.

Feedback reset / delayed scroll
  success → keep the existing reset or scroll
  CancellationError → return
  other error → log with private error details

Local catches keep each failure next to its operation. A shared helper would add an abstraction for only three sites. Existing task ownership and the outer catchError callback remain unchanged.

Evidence

Before: the baseline build completed with three target diagnostics.
After: the build completed with zero target diagnostics. The existing suite passed: 37 tests in 13 suites.

Independent runtime checks on macOS 27.2 confirmed success/failure feedback and its approximately two-second reset. Each failure activation called catchError once. Removing a cooperative running button delivered cancellation once. A local page scrolled to Y=600. A page whose scrollBy throws stayed alive and logged its error as <private>.

Success and failure feedback in the macOS test host
Cooperative cancellation after removing the running button
Local pages after normal scrolling and a thrown script error

These are post-change captures, not a historical visual comparison. The before/after evidence is the compiler diagnostic count.

Build and tests ran sequentially through simlease, using swift build / swift test --build-system swiftbuild --jobs 1 with an isolated scratch path. Reviewed and exercised commit: 81178270920902dd27bf707d9644af70751a7426.

Larger-font rendering was attempted but not verified. Not checked: internal timer/scroll-task cancellation, keyboard/VoiceOver, other platforms, or release readiness. The repository has no CODING_STANDARDS.md; code review used the available workspace and Swift rules. No new regression tests were added. No browser rendering check ran. Review: Code ✓ · Design – (no visual redesign) · QA ✓ (specified macOS flows only).

Merge Danger

Door two-way · Blast Radius local (feedback timers and delayed page scroll).
Public APIs and task ownership are unchanged. The detector reported exit 0. It assumes a local radius because the repository has no BlastRadius.md.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant