Skip to content

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

Closed
@andrewkolos

Description

@andrewkolos

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.

Metadata

Metadata

Assignees

Labels

P2A bug or feature request we're likely to work onpackage:unified_analyticstype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions