urlsession-code-review

URLSession Code Review

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "urlsession-code-review" with this command: npx skills add existential-birds/beagle/existential-birds-beagle-urlsession-code-review

URLSession Code Review

Quick Reference

Topic Reference

Async/Await async-networking.md

Requests request-building.md

Errors error-handling.md

Caching caching.md

Review Checklist

Response Validation

  • HTTP status codes validated - URLSession does NOT throw on 404/500

  • Response cast to HTTPURLResponse before checking status

  • Both transport errors (URLError) and HTTP errors handled

Memory & Resources

  • Downloaded files moved/deleted (async API doesn't auto-delete)

  • Sessions with delegates call finishTasksAndInvalidate()

  • Long-running tasks use [weak self]

  • Stored Task references cancelled when appropriate

Configuration

  • timeoutIntervalForResource set (default is 7 days!)

  • URLCache sized adequately (default 512KB too small)

  • Sessions reused for connection pooling

Background Sessions

  • Unique identifier (especially with app extensions)

  • File-based uploads (not data-based)

  • Delegate methods used (not completion handlers)

Security

  • No hardcoded secrets (use Keychain)

  • Header values sanitized for CRLF injection

  • Query params via URLComponents (not string concat)

Output Format

Critical

  1. [FILE:LINE] Missing HTTP status validation
    • Issue: 404/500 responses not treated as errors
    • Fix: Check httpResponse.statusCode is 200-299

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

langgraph-code-review

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

docling

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

python-code-review

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

fastapi-code-review

No summary provided by upstream source.

Repository SourceNeeds Review