I only noticed this when I accidentally typed invalid characters and saved it into the log file, but if the parser is not able to parse each row of the json file, the entire process will fail. As a result, anything that requires calling for analytics.logFileStats()
will fail, which includes fetching available surveys.
{"client_id":"fe4a035b-bba8-4d4b-a651-ea213e9b8a2c","events":[{"name":"lint_usage_count","params":{"count":1,"name":"unnecessary_parenthesis"}}],"user_properties":{"session_id":{"value":1695847559001},"flutter_channel":{"value":null},"host":{"value":"macOS"},"flutter_version":{"value":"3.14.0-14.0.pre.518"},"dart_version":{"value":"3.2.0-199.0.dev"},"analytics_pkg_version":{"value":"4.0.0"},"tool":{"value":"vscode-plugins"},"local_time":{"value":"2023-09-27 16:46:01.831138 -0400"}}}
{"client_id":"fe4a035b-bba8-4d4b-a651-ea213e9b8a2c","events":[{"name":"lint_usage_count","params":{"count":4,"name":"prefer_final_fields"}}],"user_properties":{"session_id":{"value":1695847559001},"flutter_channel":{"value":null},"host":{"value":"macOS"},"flutter_version":{"value":"3.14.0-14.0.pre.373"},"dart_version":{"value":"3.2.0-174.0.dev"},"analytics_pkg_version":{"value":"3.1.0"},"tool":{"value":"vscode-plugins"},"local_time":{"value":"2023-09-27 16:46:01.866532 -0400"}}}
}}
{"client_id":"fe4a035b-bba8-4d4b-a651-ea213e9b8a2c","events":[{"name":"lint_usage_count","params":{"count":4,"name":"prefer_final_in_for_each"}}],"user_properties":{"session_id":{"value":1695847559001},"flutter_channel":{"value":null},"host":{"value":"macOS"},"flutter_version":{"value":"3.14.0-14.0.pre.373"},"dart_version":{"value":"3.2.0-174.0.dev"},"analytics_pkg_version":{"value":"3.1.0"},"tool":{"value":"vscode-plugins"},"local_time":{"value":"2023-09-27 16:46:01.902782 -0400"}}}
In the example above, the third line item is not a valid record, if we encounter something like this, the package should ignore the malformed line and have the malformed line get phased out on its own since we cap the number of records to store locally