Commit Graph
141 Commits
Author SHA1 Message Date
bff6b664d1 Merge release-6.34.0 branch after patch (#6701)
* Update versions for Release 6.34.0

* 6.34.0 updates for SwiftPM (#6614)

* M81 FIS cherry pick of #6570 (#6616)

* FIS: Additional FIRInstallationsItem validation (#6570)

* FIS API tests for no FID in response

* FIRInstallationsIDControllerTests: test names

* FIRInstallationsIDControllerTests: corrupted storage tests

* FIRInstallationsItem validation

* Fix FIRInstallationsItem.IIDDefaultToken copy

* Improve error description.

* FIRInstallationsItem validation error

* FIRInstallationsItem validation tests

* ./scripts/style.sh

* FIRInstallationsIDController: validate stored installation

* FIRInstallationsAPIService installation validation

* Changelog

* Update versions

* patch version

* release manifest

* FIS: don't log anything on success validation (#6635)

* Update changelogs (#6649)

* GoogleDataTransport: deprecated API conditions (#6697)

* GoogleDataTransport: deprecated API conditions

* Version bump

* use `TARGET_OS_IOS`

* changelog

* changelog

* style

* Fix merge

Co-authored-by: Ryan Wilson <wilsonryan@google.com>
Co-authored-by: Paul Beusterien <paulbeusterien@google.com>
Co-authored-by: Morgan Chen <morganchen12@gmail.com>
2020-10-08 15:11:00 -04:00
Paul Beusterien 4507ad146b Fix CI/regression - update for change FCM API (#6699) 2020-10-08 11:06:02 -07:00
Ryan Wilson 769fa7b446 Fixed CHANGELOG location. (#6698) 2020-10-08 13:02:08 -04:00
Ryan Wilson 19159a4b25 Fix tvOS storage issues. (#6658)
* Fix tvOS storage issues.

On tvOS devices, the ApplicationSupport directory cannot be used.
Unfortunately this doesn't come up in simulator testing, only on device.
This hasn't been fully tested on device but given that any writes to the
ApplicationSupport directory fail on tvOS, this change can't break much.

Fixes #6612

@defagos can you please give this a test?

* Fixed changed dir name for RC

* Fixed test naming, too.

* Fix the documentation comment for GoogleUtilities.

* Updated changelog.

* Review feedback
2020-10-08 11:28:41 -04:00
Maksym Malyhin bde8e07844 GDT: move some headers from public to internal (#6643)
* Move extra public headers to Internal and fix imports

* Cleanup

* Use relative paths in internal headers

* Fix imports in internal headers

* ./scripts/style.sh

* Fix GDTTestApp

* Fix test app

* Use real uploader for watchOS test app

* comma
2020-10-05 14:00:49 -04:00
Maksym Malyhin babd8e63bd GDT: Move GDTCORAssert.h to internal headers (#6638)
* Move GDTCORAssert.h to internal headers

* Fix import
2020-10-01 20:56:26 -04:00
Maksym Malyhin 38be2cc8c6 GDTCORDirectorySizeTracker: fix NSURL constructor (#6580)
* GDTCORDirectorySizeTracker: replace optional NSURL constructor with non-optional.

* GDTCORDirectorySizeTracker tests for the issue

* ./scripts/style.sh

* changelog
2020-09-28 11:01:32 -04:00
Maksym Malyhin 8779479510 GDTCORFlatFileStorageTest size limit tests: use timeout proportional to the number of events (#6537) 2020-09-23 13:44:20 -04:00
Maksym Malyhin 94fb0d1b11 GDT readme: log level configuration (#6513)
* GDT readme: log level configuration

* Typo fix

* Trailing whitespaces
2020-09-21 13:59:37 -04:00
Maksym Malyhin ca44b646b8 GDT: remove pre Xcode 10 availability checks (#6486)
* GDT: remove pre Xcode 11 availability checks

* Revert Xcode 10 required availability checks

* Changelog
2020-09-17 15:31:44 -04:00
Maksym Malyhin cd844903ab GDT tests: Xcode 12 fixes (#6469)
* GDT tests: Xcode 12 fixes

* Silent unused warnings for weakSelf vars (for Xcode 12)
2020-09-16 10:45:31 -04:00
Maksym Malyhin 57101b28a9 GDTTransformer: fix background tasks handling (#6457)
* GDTCORTransformer: background task tests

* GDTCORTransformer: background tasks handling fix

* Copyright

* Changelog

* Comments

* rand() -> arc4random()

* GDTCORTransformer tests for default initializer

* Fix default initializer

* ./scripts/style.sh

* Pass weak application reference to the blocks
2020-09-15 11:02:48 -04:00
Maksym Malyhin a59febae5a GDT: storage size limit (#6365)
* GDTCORFlatFileStorageTest: test storage size limit

* Size limit slow implementation.

* GDTCORFlatFileStorage: prefetch file size

* GDTCORDirectorySizeCalculator introduced

* GDTCORDirectorySizeCalculator integration with GDTCORFlatFileStorage

* Storage size calculation tests

* Cleanup

* Cleanup

* API docs

* Fix type

* Tests

* Tests - don't hardcode event size

* Changelog

* Fix tests on slower CI.

* API docs

* Tests comments

* GDTCORFlatFileStorageTest failure debug

* GDTCORFlatFileStorageTest debug: make sure all generated events stored.

* GDTCORFlatFileStorageTest debug

* GDTCORFlatFileStorageTest debug: dynamically generate events

* Cleanup

* Renaming GDTCORDirectorySizeCalculator->GDTCORDirectorySizeTracker

* Size tracker lazy initialization

* Remove old code

* Size tracker methods renaming

* Cleanup

* Additional tests
2020-09-11 10:42:30 -04:00
Maksym Malyhin 97fb24e09c GDTCORClockTest: decrease expected timestamp accuracy to fix test flakes (#6330) 2020-08-25 16:19:20 -04:00
f33276f530 Update nanopb py3 0.3.9.5 -> 0.3.9.6 (#6214)
* update nanopb from 0.3.9.5 to 0.3.9.6

This fixes issues building firestore SDK with Python3.
Interestingly, latest version 0.4.2 still errors during the build
but 0.3.9.6 works. The git commit for this fix in nanopb
https://github.com/nanopb/nanopb/commit/63f8e5e4946a5f8f0211b454bd37187871c3d023

* Update generated sources

* updating just nanopb dependency version

nanopb updated from 0.3.9.5 to 0.3.9.6
(pod version 1.30905.0 to 1.30906.0)

* Add missing source specifier

* Generated files for protos using nanopb 0.3.9.6

* removed unnecessary whitespaces in files generated by protoc

* using more qualified relative paths for header includes

* Changelog

Co-authored-by: Marek Gilbert <mcg@google.com>
Co-authored-by: Paul Beusterien <paulbeusterien@google.com>
2020-08-14 14:13:01 -07:00
Maksym Malyhin 802cb6a716 GDT: revert cc_scub annotations (#6274) 2020-08-13 16:06:43 -04:00
Tejas Deshpande ab6fc616b4 Fix clang-tidy (#6270) 2020-08-13 11:18:40 -04:00
Tejas Deshpande b449bee0a2 Create an additional URL target for internal use (#6254)
#no-changelog
2020-08-12 18:20:21 -04:00
Maksym Malyhin 2683e9da53 GDTCORClock: use NSTimeZone to get a timezone with respect of daylight (#6246)
* GDTCORClock: use NSTimeZone to get a timezone with respect of daylight

* Changelog
2020-08-10 17:00:26 -04:00
Paul Beusterien 70d4e8a6e6 GDT remove @import (#6178) 2020-07-31 09:26:49 -07:00
Paul Beusterien 85e3354346 GDT - new public header structure (#6177) 2020-07-31 08:12:23 -07:00
Paul Beusterien a372ed2a27 import nanopb without touching CocoaPods imports (#6165) 2020-07-30 14:54:37 -07:00
Paul Beusterien 0b977bd636 Revert "Remove #if SWIFT_PACKAGE checks for nanopb (#6163)" (#6164)
This reverts commit 303f8ca7bb.
2020-07-30 08:40:47 -07:00
Paul Beusterien 303f8ca7bb Remove #if SWIFT_PACKAGE checks for nanopb (#6163) 2020-07-30 06:49:46 -07:00
Maksym Malyhin fa26512015 GDT: fix time units for the request and events uptime (#6102)
* GDTCORClock: fix uptime and kernelBootTime units

* GDTCCTNanopbHelpers: fix time units for the batch and events snapshot uptime

* Formatting

* GDTCORClock: properties rename and deprecation.

* Changelog updates

* Fix renaming issues

* Cleanup

* GDTCORClockTest: reduce timestamp comparison accuracy
2020-07-22 11:49:55 -04:00
Maksym Malyhin ec018dcbd7 [GDTCORUploadCoordinator startTimer]: don't restart timer if already started (#6032)
* [GDTCORUploadCoordinator startTimer]: don't restart timer if already started

* style

* `GDTCORUploadCoordinator.timer` - nullable

* GDTCORUploadCoordinator test utils thread safety.
2020-07-13 17:35:20 -04:00
Maksym Malyhin 744fd1865b GDTCORFlatFileStorage: keep not expired events when expired batch removed (#6010)
* GDTCORFlatFileStorage: expiration clean up tests

* GDTCORFlatFileStorage: keep not expired events when expired batch removed

* Cleanup

* Cleanup

* Comments

* Comments

* Remove additional delays in tests

* style

* Changelog
2020-07-09 17:12:54 -04:00
Maksym Malyhin 4dd48bdcd9 GDT: Retry uploading batches failed to upload before the app termination (#5942)
* GDTCCTUploaderTest: test a lost batch upload retry

* GDTCCTUploader: refactoring to prepare for lost batches uploading

* GDTCCTUploader: Upload previously batched events first

* Fix GDTCCTTestStorage

* Refactor GDTCCTUploaderTest

* GDTCORFlatFileStorageTest: batch tests

* GDTCORFlatFileStorage: refactor removeBatchWithID to prepare for eventsForbatchID

* eventsInBatchWithID implementation

* Fix tests

* Uploader fix for empty batch state

* GDTCORUploadCoordinator: high priority targets

* style

* GDTCCTUploaderTest

* GDTCCTUploaderTest: cleanup

* Cleanup and API docs.

* GDTCORUploadCoordinator: revert high priority targets

* GDTCCTUploader: make sure GDTCOREventQoSFast is part of a regular batch as well.

* Cleanup

* GDTCCTUploader: don't report ready for upload until there are events.

* GDTCCTUploaderTest: move failed batch back to the queue

* GDTCORFlatFileStorage: removeBatchWithID with deleteEvents==NO

* GDTCORFlatFileStorage: remove batch directory

* style

* GDTCORFlatFileStorage: comments and debug logs

* formatting

* GDTCCTUploaderTest: recover tests

* GDTCCTTestServer: support for async request handler

* GDTCCTUploaderTest: ongoing request tests

* GDTCORStorageProtocol: remove redundant `eventsInBatchWithID` method.

* GDTCORFlatFileStorageTest: `removeBatchWithID` tests

* Cleanup

* GDTCORFlatFileStorage: cleanup

* GDTCORFlatFileStorageTest: better coverage and cleanup

* Comments and improvements

* GDTCCTUploaderTest: reduce code duplication

* GDTCCTUploaderTest: conditions tests

* GDTCCTUploader: fix next request wait time

* run ./scripts/style.sh
2020-07-07 09:10:22 -04:00
Paul Beusterien d653c9584c Update copyright presubmit and fix 2020 copyrights (#5944) 2020-06-29 13:16:19 -07:00
Paul Beusterien 6e0e53aae8 Fix GDTCCT build (#5935) 2020-06-29 07:08:27 -07:00
Maksym Malyhin dbef679b38 GDT: Fix test storage type mismatches (#5912) 2020-06-25 12:22:15 -04:00
Maksym Malyhin 527ce9049f Use UUID as GDTCOREvent.eventID (#5907)
* Remove unused header from FIRCoreDiagnosticsTest

* Use UUID as GDTCOREvent

* Fix analyzer issue

* run ./scripts/style.sh

* Code review comments
2020-06-25 09:46:01 -04:00
Paul Beusterien 5a5914da7e GDT Repo-relative imports and SPM (#5909) 2020-06-24 17:50:15 -07:00
Paul Beusterien e03a8d91a0 Consolidate GDT and GDTCCT to a single pod (#5902) 2020-06-24 14:09:46 -07:00
Michael Haney a00703a543 Completely reimplement storage in GDT (#5877)
* Revert "Revert GDTCORStorage changes for now (#5778)"

This reverts commit 93eb6d8c48.

* Store events and implement unit tests (#5790)

Resolves many TODOs in the flat file storage system
Bug fixes found by unit tests are also included.

* Get rid of event iterators and add separate folders for batching (#5829)

* Store events and implement unit tests (#5790)

Resolves many TODOs in the flat file storage system
Bug fixes found by unit tests are also included.

* Change to explicit nil comparison

* Address test comments

- Makes all APIs async
- Add thread-safety test
- Comments on where files are stored
- Broke up the library data get/set API into two blocks

* Implement events and batch expirations (#5842)

The upload coordinator will signal an expiration check whenever the app foregrounds.

* Remove prioritizers, upload packages, data futures, and backwards compatibility (#5874)

* Remove prioritizers, upload packages, data futures, and backwards compatibility

* Update a comment and console logging

* Reset the storage for every unit test, move event generation out of core init

* Return a nil request if data is nil.

* Fix prioritizer reference in watchOS test app

* Remove unnecessary check for termination

* Give more leeway for eventID generation

Change the transport API to a GDTCORTarget
Don't continue a long test after a failure

* Return nil if an eventID couldn't be created

Fix some swift in the watchOS test app

* Fix all rawValue GDTCORTarget usage

* Update CHANGELOGs

* Remove initializer annotations (#5878)

* Remove initializer designation from GDTCOREvent

Change the target property to the target type

* Add a couple more types

* Make implicit retain explicit

Nothing I do seems to get this warning to trigger locally...

* Address loss of precision issue

* Re-enable a disabled test

Don't delete while enumerating

* Additional test tweaks and hasEvents is now on the queue and async

* Adjust GDTCCT to the new API

* Always attempt to create a path, get rid of implicit self refs

* Change all waiting for be DISPATCH_TIME_FOREVER for debugging purposes

I suspect the travis machines are just overwhelmed, since the test errors don't make any sense.

* Try using a different separator

* Enable debug logging

* Enable verbose pod lib lint output

* Handle cases where the mappingID contains path components

* Revert "Enable debug logging"

This reverts commit b3e4a6ecc5.

* Revert "Enable verbose pod lib lint output"

This reverts commit a5b54460f9.

* Revert "Change all waiting for be DISPATCH_TIME_FOREVER for debugging purposes"

This reverts commit 55e4fff5dc.

* Attempt to create a folder before writing

* Temporarily enable verbose pod lib lint, again

* Temporarily add debug logging back in

* Don't double store events

Also print out errors if there are any

* Remove debug logging

* Put debug logs back in for Crashlytics test

* Update mock APIs to match and use a real target

* remove debug logging

* Apply nullability specifiers to Crashlytics mock class
2020-06-23 16:04:18 -07:00
Visu de94d1d7a2 Make the deviceModel to be a static variable to avoid overwrites. (#5847) 2020-06-18 10:07:18 -07:00
VisuandPaul Beusterien 4a6f6135be Update the device model identified by GDTCCTLibrary to be more detailed and in parity with Clearcut. (#5836)
Update the device model identified by GDTCCT library to be more detailed and in parity with Clearcut.

Current GDT implementation returns "iPhone". With this change, the device model identified would be iPhoneA,B (Eg. iPhone 8,1).

Co-authored-by: Paul Beusterien <paulbeusterien@google.com>
2020-06-17 09:42:18 -07:00
Michael Haney 93eb6d8c48 Revert GDTCORStorage changes for now (#5778)
* Revert "Refactor event saving and searching (#5773)"

This reverts commit a61786cbf1.

* Revert "Expand the storage protocol and provide an event iterator (#5742)"

This reverts commit 641d8531a3.

* Revert "Implement helpers for storing and finding events (#5738)"

This reverts commit 9a0aed81b0.
2020-06-09 13:55:15 -07:00
Michael Haney a61786cbf1 Refactor event saving and searching (#5773)
* Refactor event saving and searching

No more symlinks to try and speed searching. Just get a directory's contents and check the filename, which will contain metadata about the event.

* Change one string formatter

* Fix the type of some params, remove unused code

* Minor update

* Continue running after failing to process a file
2020-06-09 11:19:38 -07:00
Michael Haney 641d8531a3 Expand the storage protocol and provide an event iterator (#5742)
* Expand the storage protocol and provide an event iterator

* Remove unused variable

* Remove unused variable

* Make implicit self retain explicit

* Just check for NSFileTypeRegular instead

And fix a comment

* Missed a damned implicit self retain

* Implement some tests for the new API

* Fix yet another implicit self retain
2020-06-05 12:16:33 -07:00
Michael Haney 9a0aed81b0 Implement helpers for storing and finding events (#5738)
* Implement helpers for storing and finding events

* Fix missing imports

* Add clarifying comments and remove unneeded nullability

Also remove a test and fix the behavior of searchPathsWithEventSelector

* Added missing docs and properly implemented +reset
2020-06-03 14:10:08 -07:00
Michael Haney 20dfcbc62b Update GDT versions and deps (#5713)
* Update GoogleDataTransport.podspec

* Update GoogleDataTransportCCTSupport.podspec

* Update FirebaseCrashlytics.podspec

* Update CHANGELOG.md

* Update GoogleDataTransportCCTSupport.podspec

* Update FirebaseCrashlytics.podspec
2020-06-02 11:03:38 -07:00
Michael Haney 0d526fd19c Change upload coordinator to not block main thread (#5712)
* Change upload coordinator to not block main thread

Fixes #5707 
Fixes #5708

* Update CHANGELOG.md
2020-06-01 12:33:51 -07:00
Michael Haney 65e0a9896b Add a global function to get storage instances (#5682)
* Add a global function to get storage instances

* Fix missing header

* Update CHANGELOG.md
2020-05-27 13:23:54 -07:00
Michael Haney 82cb49a959 Update GDT CHANGELOG and version (#5690)
* Update CHANGELOG.md

* Update GoogleDataTransport.podspec

* Update GoogleDataTransport.podspec

* Update CHANGELOG.md
2020-05-27 13:08:46 -07:00
Michael Haney 1be5de4899 Provide an arbitrary data persistence mechanism on storage instances (#5637)
* Provide a library data mechanism on storage instances

This could allow most singletons to no longer need NSCoding, they just store the individual fields they need with an appropriately unique key

* Additional  tests

And no more implicit removal

* Implement read error capture

* Make test file data keys more unique

Also, there _should_ be an error reading from a non-existent file.
2020-05-19 15:29:05 -07:00
Michael Haney 08938f7c32 Fixes the count file not being found (#5584)
* Fixes the count file not being found

Calling the new GDTCORRootDirectory() function ensures that the directory needed is created before an attempt to write is made.

Fixes #5549

* Update CHANGELOG and versions
2020-05-12 15:17:09 -07:00
Michael Haney 7ddbb42034 Print out counter error message. (#5552)
* Print out counter error message.

* style
2020-05-08 13:45:49 -07:00
Michael Haney 4f88be1118 Update GDT CHANGELOGs, versions, and dependencies. (#5480) 2020-04-28 11:11:11 -07:00
Michael Haney 54c7fc63e9 Move reachability flags initialization to +initialize from +load (#5477) 2020-04-27 14:56:22 -07:00