Skip to content

Conversation

@tladesignz
Copy link

Changes in this pull request

When trying to integrate this lib in a demo app, I stumbled accross 2 problems:

  1. I accidentally destroyed my recorded photo, because the defaults in public convenience init(fileURL url: URL, truncate: Bool = true, createIfNeeded: Bool = true) are a footgun.

  2. I couldn't read from read-only files (asset files bundled with the app), because let fh = try FileHandle(forUpdating: url) will throw when you try to do that.

Hence, this PR which suggests a change in the way a Stream is initialized, which makes it obvious what is for what, and also works with read-only files.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • All applicable changes have been documented
  • Any TO DO items (or similar) have been entered as GitHub issues and the link to that issue has been included in a comment

Sorry, can you please point out what to do at All applicable changes have been documented in this case? Thank you!

@tladesignz
Copy link
Author

For context: I'm working with @redaranj for the Guardian Project.

@codecov
Copy link

codecov bot commented Nov 13, 2025

Codecov Report

❌ Patch coverage is 95.58824% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.62%. Comparing base (33df1c8) to head (e957834).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
Library/Sources/Stream.swift 92.10% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #27      +/-   ##
==========================================
+ Coverage   57.54%   57.62%   +0.07%     
==========================================
  Files          20       20              
  Lines        2744     2749       +5     
==========================================
+ Hits         1579     1584       +5     
  Misses       1165     1165              
Flag Coverage Δ
unittests 57.62% <95.58%> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@redaranj
Copy link
Contributor

I think this makes the different stream use cases much clearer and is a big improvement.

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.

3 participants