Commit Graph
12 Commits
Author SHA1 Message Date
manjanac 2c4c19be42 Logging on-device + Firelog (#7386)
* Restores ML Pods after M77.

* Fix Package.swift

* Re-add catalyst to GHA workflow.

* Add new error type for expired url + fix tests.

* On-device logging + updates to tests.

* Add new error type for expired url + fix tests.

* On-device logging + updates to tests.

* Revert to enum for ModelFileManager.swift

* Remove GoogleService-Info.plist

* Remove GoogleService-Info.plist
2021-01-27 13:22:05 -08:00
manjanac 3ac79da402 Move retryDownload to ModelDownloader (#7374)
* Restores ML Pods after M77.

* Fix Package.swift

* Re-add catalyst to GHA workflow.

* Refactor WIP - TODO: Refactor retryDownload handlers.

* Refactor WIP - TODO: Fix unit test.

* Refactor WIP - TODO: Refactor retryDownload handlers.

* Refactor retryDownload() + unit tests.

* Minor fixes.

* Resolve merge conflicts with master.
2021-01-25 17:38:12 -08:00
manjanac ad41e22f1a Device logging w/ GULLogger. (#7348)
* Restores ML Pods after M77.

* Fix Package.swift

* Re-add catalyst to GHA workflow.

* Replace device logger with GULLogger.

* Replace device logger with GULLogger.

* Add GoogleUtilities dependency to Package.swift.

* Add GoogleUtilities dependency to Package.swift.

* Add GoogleUtilities dependency to podspec.

* Fix import in DeviceLogger.

* Remove extra new lines.
2021-01-25 17:15:15 -08:00
manjanac e6fa9d42c1 Downloader protocol + tests (#7352)
* Restores ML Pods after M77.

* Fix Package.swift

* Re-add catalyst to GHA workflow.

* Add mocks for better unit tests - WIP.

* Remove duplicate proto files.

* Download task protocol + tests.

* Rename protocol file.

* Import foundation.

* Rename to authTokenProvider.

* Rename to authTokenProvider.

* Consolidate handlers for download task.

* Merge #7355.

* Clean up unit tests + add test for successful download retry.

* Add TODO to refactor retry download + add test.

* TODO to handle failed precondition.
2021-01-22 18:28:17 -08:00
manjanac bbd9495b56 Implement model download conditions. (#7307)
* Restores ML Pods after M77.

* Fix Package.swift

* Re-add catalyst to GHA workflow.

* Implement model downloading conditions. Error handling WIP

* Remove background downloading + add waitsForConnectivity where available.

* Resolve merge conflicts with master.

* Resolve merge conflicts with master.
2021-01-21 16:22:57 -08:00
manjanac a8ce5b0308 Handle expired download URL with support for retries (#7329)
* Restores ML Pods after M77.

* Fix Package.swift

* Re-add catalyst to GHA workflow.

* Update error handling.

* Add logging for background download failure.

* Handle expired download URL.

* Remove empty file.

* Fix integration test.

* Minor refactor.
2021-01-20 11:09:39 -08:00
manjanac d7950ddbe4 Separate error messages into extensions (#7322)
* Restores ML Pods after M77.

* Fix Package.swift

* Re-add catalyst to GHA workflow.

* Update error handling.

* Add logging for background download failure.

* Remove empty file.

* Slight refactor of error descriptions + using ISO8601DateFormatter where available.

* Slight refactor error descriptions + adding availability for ISO8601DateFormatter.
2021-01-19 14:28:20 -08:00
manjanac ac4d70ed41 Logging on device and to Firelog (#7281)
* Restores ML Pods after M77.

* Fix Package.swift

* Re-add catalyst to GHA workflow.

* Logging on-device and to Firelog - WIP.

* Logging on-device and to Firelog - WIP.

* Rename AnalyticsLogger to TelemetryLogger + minor fixes.

* Add SwiftProtobuf dependency.

* On-device and Firelog logging - WIP

* Proto files.

* Rename loggers.

* Move protos to Sources.

* Log model download event on device and to Firelog.

* Add TODO to revisit SwiftProtobuf dependency + minor fixes.

* Add SwiftProtobuf dependency to Package.swift.

* TODO to revisit system info + TODO in podspec for SwiftProtobuf dependency.

* Pass app to TelemetryLogger to check for stats enabled flag.

* TODO to replace on device logEvent with GULLogBasic (future PR).
2021-01-14 15:29:04 -08:00
manjanac f6e61e36c1 Logical checkpoint of ModelDownloader implementation (#7259)
* Restores ML Pods after M77.

* Fix Package.swift

* Re-add catalyst to GHA workflow.

* Includes the implementation of: 1) download types, 2) list models, 3) delete model.

* Add protocol to handle writing to user defaults.

* Add protocol to handle writing to user defaults.

* Add empty init to ModelDownloadConditions.

* Copyright year + other minor fixes.

* TODO to use FirebaseApp internal init for test app.

* Test if download progress is in range.

* Remove not nil test for progress.

* Remove not nil test for progress.
2021-01-07 14:54:12 -08:00
manjanac 1a1a91a225 Refactor modelInfo into localModelInfo and remoteModelInfo (#7163)
* Restores ML Pods after M77.

* Fix Package.swift

* Refactor model info to be in-memory.

* Add improved model download functionality w/ single set of download handlers per task.

* Rename model download to better match URLSessionTask.

* Rename model download to better match URLSessionTask.

* Update unit test to read/write to user defaults.

* Configure downloader with Firebase app.

* Minor updates to model downloader and tests.

* Singleton for model downloader instance, for default and custom app.

* Download types WIP - local model.

* Download types WIP.

* Manually add app lifecycle handling + TODOs for Firebase Components.

* Replace options with app name as a property in ModelDownloader.

* Download types WIP.

* Refactor model info.

* Add convenience inits + other minor fixes.

* Explicit enum for model info result.
2021-01-06 12:04:47 -08:00
manjanac e6b60202d4 Add singleton-ish instance methods for model downloader (public API). (#7124)
* Restores ML Pods after M77.

* Fix Package.swift

* Refactor model info to be in-memory.

* Add improved model download functionality w/ single set of download handlers per task.

* Rename model download to better match URLSessionTask.

* Rename model download to better match URLSessionTask.

* Update unit test to read/write to user defaults.

* Configure downloader with Firebase app.

* Minor updates to model downloader and tests.

* Singleton for model downloader instance, for default and custom app.

* Manually add app lifecycle handling + TODOs for Firebase Components.

* Replace options with app name as a property in ModelDownloader.

* Update unit test to check model downloader instance creation + minor rename.
2020-12-14 10:59:42 -08:00
manjanac dbdefc5163 Refactoring model download functionality. (#7068)
* Restores ML Pods after M77.

* Fix Package.swift

* Refactor model info to be in-memory.

* Add improved model download functionality w/ single set of download handlers per task.

* Rename model download to better match URLSessionTask.

* Rename model download to better match URLSessionTask.

* Update unit test to read/write to user defaults.

* Minor updates to model downloader and tests.

* Use caches directory for model storage on tvOS.

* Change modelInfo to be privately settable.
2020-12-04 15:57:16 -08:00