This document outlines the planned improvements and known issues for EKNetwork.
Status: ✅ Resolved
Resolved in: v1.4.2 — Implemented ProgressSessionManager with a shared URLSession and ProgressDelegateManager to avoid creating a new session per request. This eliminates memory leaks and improves performance. The old ProgressDelegate class has been removed.
Status: 🟡 Medium
Location: NetworkManager.swift:273-282
Problem: Force unwrap (!) is used when converting strings to Data, which can cause crashes.
Solution:
- Use safe conversion with error handling
- Or use
Data(contentsOf:)with validation
Related Issue: See GitHub issue for details
Status: ✅ Resolved
Resolved in: v1.4.1 — Base URL is now provided via closure () -> URL; updateBaseURL was removed. Each request calls the closure, so there is no shared mutable base URL and no race condition.
Status: 🟡 Medium
Location: NetworkManager.swift:507-509
Problem: Using String(describing: type(of: $0)) for type checking is unreliable.
Solution:
- Use protocols to mark errors that shouldn't be retried
- Or use
isfor type checking
Related Issue: See GitHub issue for details
Status: 🟡 Medium
Location: NetworkManager.swift:772-774
Problem: Retry logic doesn't check if Task was cancelled, leading to unnecessary retries.
Solution:
- Add
Task.isCancelledcheck before retry - Throw
CancellationErroron cancellation
Related Issue: See GitHub issue for details
Status: ✅ N/A
Resolved in: v1.4.1 — updateBaseURL was removed; base URL is now a closure. Invalid URL from the closure still leads to NetworkError.invalidURL when building the request (e.g. when URLComponents fails).
Status: 🟢 Low
Location: NetworkManager.swift:632-634
Problem: Existing query parameters in URL may be overwritten when adding new ones.
Solution:
- Check existing query parameters
- Merge them with new ones
Related Issue: See GitHub issue for details
Status: 🟢 Low
Location: NetworkManager.swift:691-695
Problem: Content-Length is not set for streams, which may cause issues with some servers.
Solution:
- Document this behavior
- Or provide option to set Content-Length
Related Issue: See GitHub issue for details
Status: ✅ N/A
Resolved in: v1.4.2 — ProgressDelegate was replaced with ProgressSessionManager and ProgressDelegateManager. Task cancellation is now handled properly through the shared session architecture.
Status: 🟢 Low
Location: NetworkManager.swift:410-420
Problem: Empty responses throw error even when they might be valid for some requests.
Solution:
- Improve documentation
- Or add option to allow empty responses
Related Issue: See GitHub issue for details
Priority: High
Status: ✅ Completed
Implemented ProgressSessionManager with a shared URLSession and ProgressDelegateManager for all progress requests.
Benefits:
- Avoid memory leaks ✅
- Better performance ✅
- Centralized management ✅
Related Issue: See CHANGELOG.md for details
Priority: High
Status: 📋 Planned
Add support for cancelling requests via Task cancellation.
Benefits:
- Better request control
- Resource savings
- Modern Swift practices compliance
Related Issue: See GitHub issue for details
Priority: Medium
Status: 📋 Planned
Use protocols instead of string type name checking.
protocol NonRetriableError: Error {}Benefits:
- Type safety
- Better performance
- Cleaner code
Related Issue: See GitHub issue for details
Priority: Medium
Status: 📋 Planned
Add ability to track request metrics (execution time, data size, etc.).
Benefits:
- Better diagnostics
- Performance monitoring
- Problem debugging
Related Issue: See GitHub issue for details
Priority: Low
Status: 📋 Planned
Add optional support for response caching.
Benefits:
- Performance improvement
- Reduced network load
- Better UX
Related Issue: See GitHub issue for details
Priority: Low
Status: 📋 Planned
Add more examples and documentation for edge cases (empty responses, cancellation, etc.).
Benefits:
- Better library understanding
- Fewer user questions
- Better developer experience
Related Issue: See GitHub issue for details
Priority: Low
Status: 📋 Planned
Add request validation before sending (URL check, headers, etc.).
Benefits:
- Early error detection
- Better error messages
- More reliable code
Related Issue: See GitHub issue for details
Priority: Low
Status: 📋 Planned
Cache frequently used URLRequest components.
Benefits:
- Better performance
- Fewer allocations
- More efficient memory usage
Related Issue: See GitHub issue for details
- Total Issues: 10
- Total Improvements: 8
- High Priority: 2 issues, 2 improvements
- Medium Priority: 3 issues, 2 improvements
- Low Priority: 5 issues, 4 improvements
- All issues are tracked in GitHub Issues
- Priority may change based on user feedback
- Contributions are welcome for any of these items
Last updated: 2026-02-03