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

[unified_analytics] FileSystemException thrown when unable to write to log file #273

Closed
andrewkolos opened this issue Jun 5, 2024 · 0 comments · Fixed by #274
Closed
Assignees
Labels
P2 A bug or feature request we're likely to work on package:unified_analytics type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@andrewkolos
Copy link
Contributor

In summary, when calling the send method on an Analytics object, the payload will be logged to a file. However, like with any file I/O operation, there is a chance for it to fail and result in a FileSystemException being thrown. Analytics.send logging to a file is an implementation detail, so there's no way for a caller to anticipate this failing and handle it appropriately. The result is that any user of unified_analtyics is susceptible to unexpected crashes.

In particular, this has become one of the top crashers of the flutter CLI tool (flutter/flutter#149196).

I suggest either 1) catching and discarding these errors (as I doubt logging analytics behavior is a critical activity) or 2) when appending to the file and an exception is encountered, flush old data from the log file and try to write again.

@andrewkolos andrewkolos added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) P2 A bug or feature request we're likely to work on package:unified_analytics labels Jun 5, 2024
@andrewkolos andrewkolos self-assigned this Jun 5, 2024
@andrewkolos andrewkolos changed the title FileSystemException thrown when unable to write to log file [unified_analytics] FileSystemException thrown when unable to write to log file Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 A bug or feature request we're likely to work on package:unified_analytics type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant