[unified_analytics] FileSystemException thrown when unable to write to log file #273
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)
In summary, when calling the
send
method on anAnalytics
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 aFileSystemException
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.
The text was updated successfully, but these errors were encountered: