Skip to content

Restore rethrows on toPresentedOverrides#6419

Merged
facumenzella merged 5 commits into
mainfrom
fix/rethrows-toPresentedOverrides
Mar 9, 2026
Merged

Restore rethrows on toPresentedOverrides#6419
facumenzella merged 5 commits into
mainfrom
fix/rethrows-toPresentedOverrides

Conversation

@facumenzella

@facumenzella facumenzella commented Mar 6, 2026

Copy link
Copy Markdown
Member

Summary

Test plan

  • swift build passes
  • SwiftLint passes

🤖 Generated with Claude Code


Note

Low Risk
Low risk: this is a type-signature/compile-time error-propagation cleanup with no change to runtime override filtering or evaluation logic.

Overview
Restores rethrows on Array.toPresentedOverrides so it only throws when the provided convert closure throws, and makes the identity overload non-throwing.

Updates several Paywalls V2 component view models to stop using try when building presented overrides, and makes VideoComponentViewModel initialization non-throwing (including removing try at its factory call site).

Written by Cursor Bugbot for commit 60dd66b. This will update automatically on new commits. Configure here.

The function was changed from `rethrows` to `throws` in #6285, but the
new filtering logic (`filter`, `allSatisfy`) doesn't throw independently
of the `convert` closure. Using `rethrows` avoids forcing unnecessary
`try` at call sites that pass non-throwing closures.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@facumenzella facumenzella added the pr:fix A bug fix label Mar 6, 2026
@facumenzella facumenzella requested review from JZDesign and vegaro March 6, 2026 16:13
@facumenzella facumenzella requested a review from a team as a code owner March 9, 2026 10:04
Since `toPresentedOverrides` is now `rethrows`, call sites passing
non-throwing closures no longer need `try`. Fixes pod lib lint warnings.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
facumenzella and others added 2 commits March 9, 2026 13:00
Resolve conflicts: use the new convenience overload (no convert closure)
without `try` for non-throwing call sites, keep `try` for Video's
throwing closure.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ializer

The `LocalizedVideoPartial.create(from:using:)` method was removed on
main. Use the direct initializer instead, which doesn't throw, allowing
the Video init and its call site to drop `throws`/`try`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@facumenzella facumenzella enabled auto-merge (squash) March 9, 2026 12:07

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

self.pageStackViewModels = pageStackViewModels

self.presentedOverrides = try self.component.overrides?.toPresentedOverrides(discardRules: discardRules)
self.presentedOverrides = self.component.overrides?.toPresentedOverrides(discardRules: discardRules)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Several inits remain throws with no throwing operations

Low Severity

After removing try from the toPresentedOverrides calls, the init methods of CarouselComponentViewModel, IconComponentViewModel, StackComponentViewModel, TabsComponentViewModel, TimelineComponentViewModel, and TimelineItemViewModel are still marked throws but no longer contain any throwing operations. VideoComponentViewModel.init was correctly updated to non-throwing, but the same cleanup was missed for these other view models. This forces all callers to use try unnecessarily.

Additional Locations (2)

Fix in Cursor Fix in Web

@facumenzella facumenzella merged commit d7aed57 into main Mar 9, 2026
13 of 17 checks passed
@facumenzella facumenzella deleted the fix/rethrows-toPresentedOverrides branch March 9, 2026 12:17
facumenzella added a commit that referenced this pull request Mar 9, 2026
Follow-up to #6419: now that `toPresentedOverrides` identity overload is
non-throwing, several view model inits no longer contain throwing operations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
facumenzella added a commit that referenced this pull request Mar 12, 2026
…6426)

Follow-up to #6419: now that `toPresentedOverrides` identity overload is
non-throwing, several view model inits no longer contain throwing operations.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:fix A bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants