Skip to content

Replace force-unwrapped URLs with URL.api(path:) helper#127

Merged
dprodger merged 1 commit into
mainfrom
claude/bold-elgamal
Apr 13, 2026
Merged

Replace force-unwrapped URLs with URL.api(path:) helper#127
dprodger merged 1 commit into
mainfrom
claude/bold-elgamal

Conversation

@dprodger

Copy link
Copy Markdown
Owner

Summary

  • Adds a URL.api(path:) extension that centralizes API URL construction with a descriptive preconditionFailure instead of scattered force-unwraps
  • Replaces 52 occurrences across 11 files — 8 force-unwrapped URL(string:)! in AuthenticationManager.swift and 44 guard let url patterns elsewhere
  • Net reduction of 140 lines by removing boilerplate guard-else blocks

Fixes #123

Test plan

  • Build and run the iOS app — verify all API calls still work (login, register, fetch songs/performers/recordings)
  • Test auth flows: login, register, logout, password reset
  • Test data browsing: songs, performers, recordings detail views
  • Test contribution editing, favorites, and repertoire features

🤖 Generated with Claude Code

Add a URL.api(path:) extension that centralizes API URL construction
with a descriptive preconditionFailure instead of scattered force-unwraps.
Replaces 52 occurrences across 11 files.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dprodger dprodger merged commit 37e26ba into main Apr 13, 2026
1 check passed
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.

P4 #5: Replace force-unwrapped URLs in AuthenticationManager with URL.api(path:) helper

1 participant