Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use latest write APIs to prevent a crash when storage is full. #87

Merged
merged 2 commits into from
Jul 22, 2021

Conversation

AvdLee
Copy link
Contributor

@AvdLee AvdLee commented Jul 21, 2021

We used to use the write(_:) method which has the following documentation:

This method raises an exception if the file descriptor is closed or is not valid, if the receiver represents an unconnected pipe or socket endpoint, if no free space is left on the file system, or if any other writing error occurs.

This resulted in several crashes for users which storage was full. With this PR, we fix the crash for users on iOS 13.4 and up which seems good enough for now.

@AvdLee AvdLee self-assigned this Jul 21, 2021
@AvdLee AvdLee requested review from amirdew and kevinrenskers and removed request for Boris-Em July 21, 2021 15:28
Copy link
Contributor

@kevinrenskers kevinrenskers left a comment

Choose a reason for hiding this comment

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

Good catch!

@wetransferplatform
Copy link
Collaborator

Warnings
⚠️

Sources/DiagnosticsLogger.swift#L143 - It is safer to use weak instead of unowned

⚠️

Sources/DiagnosticsLogger.swift#L186 - It is safer to use weak instead of unowned

Messages
📖

View more details on Bitrise

📖 Diagnostics: Executed 19 tests, with 0 failures (0 unexpected) in 0.310 (0.629) seconds

Diagnostics.framework: Coverage: 77.11

File Coverage
DiagnosticsLogger.swift 62.25%

Generated by 🚫 Danger Swift against 1baffc9

Copy link
Contributor

@kairadiagne kairadiagne left a comment

Choose a reason for hiding this comment

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

Looks good!

@AvdLee AvdLee merged commit 3c72dc5 into master Jul 22, 2021
@AvdLee AvdLee deleted the feature/log-crash-fix branch July 22, 2021 11:22
@wetransferplatform
Copy link
Collaborator

Congratulations! 🎉 This was released as part of Release 1.9.1 🚀

Generated by GitBuddy

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.

5 participants