111 Commits
Author SHA1 Message Date
Paul BeusterienandNick Cooke 537b79836b Log ignored GULMutableDictionary writes and document nil handling (#251)
* fix(network): log ignored GULMutableDictionary writes and document nil handling

Follow-up to the nil-key fix in #249.

- Log a warning (I-NET902000 for a nil key, I-NET902001 for a nil object)
  when a write is ignored. Silently dropping the write hid the caller's bug;
  the log keeps it visible without crashing.
- Mark the object parameter of -setObject:forKeyedSubscript: as nullable. A
  nil object removes the key, as with NSMutableDictionary, and the tests rely
  on this. It also lets Swift callers write `dict[key] = nil`.
- Document the nil handling in the header.
- Make testNilObjectIsIgnored check that an existing entry is kept, and pass
  nil directly in testKeyedNilObjectRemovesKey.

* fix(network): move GULMutableDictionary log codes to 903xxx

I-NET902000-I-NET902006 are already used by GULReachabilityMessageCode, so
the new GULMutableDictionary warnings collided with reachability messages.
Use 903000/903001, which are unused in GoogleUtilities and
firebase-ios-sdk, and note the reserved reachability range next to the
enum.

* add more nil key tests

* fix(network): return nil early for nil keys in GULMutableDictionary getters

NSDictionary happens to return nil for a nil key, but this is not
documented. Return early from -objectForKey: and
-objectForKeyedSubscript: so the behavior does not depend on Foundation
and matches the nil-key guards on the write paths.

- Document the nil-key behavior of both getters in the header.
- Add tests that a nil-key lookup returns nil when the dictionary has
  entries.

* test(network): add defensive GULMutableDictionary tests

- Check that -dictionary returns a snapshot that later writes don't change.
- Split the nil-key write test into one test per write path so a failure
  names the method that caused it, and cover `dict[nil] = nil`.
- Cover removing a missing key, -removeAllObjects on an empty dictionary,
  and -description.

* changelog and spec

* test(network): assert empty precondition in testRemoveAllWhenEmpty

* test(network): verify setup in GULMutableDictionary tests

Several tests could pass even if their setup silently failed. Check that
the setup took effect:

- testDictionaryReturnsSnapshot: the later writes changed the live
  dictionary, so the snapshot assertions are meaningful.
- testKeyedNilObjectRemovesKey: the entry exists before it is removed.
- testObjectForNilKey(KeyedSubscript): the entry exists, so the tests
  show a nil key does not match it.

* fix(network): mark GULMutableDictionary getters as returning nullable

objectForKey: and objectForKeyedSubscript: are documented to return nil for a missing or nil key, but were declared non-null, so Swift imported objectForKey(_:) as Any. Declare both as nullable id so the signatures match the documented behavior. Swift callers of objectForKey(_:) now get Any?; the subscript already read as Any? because its setter is nullable.

* test(network): add GULMutableDictionary concurrent access stress test

GULMutableDictionary is documented as providing atomic accessors and
mutators and is shared across threads by GULNetwork and the app delegate
swizzlers, but no test exercised it concurrently. Mix reads, writes,
removes, and nil-key calls across threads with dispatch_apply and check
that the final state is consistent.

Passed 200 repeated runs and a Thread Sanitizer run on the iOS simulator
with no reports.

---------

Co-authored-by: Nick Cooke <nickcooke@google.com>
2026-09-29 16:11:36 -07:00
Nick Cookeandgoogle-labs-jules[bot] 92c8f6dc3a Release version 8.1.3 (#246)
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2026-08-25 18:49:49 -04:00
Nick Cooke e4035cf5d3 infra: remove OCMock dependency (#243)
* test: migrate away from OCMock

Replace dynamic OCMock mocks with handwritten fake classes across the test suite to improve Swift interoperability, address concurrency issues, and reduce test brittleness. Removed OCMock from podspec and SPM dependencies.

* gemfile

* Remove other files and deps

* Apply suggestion from @ncooke3

* Apply suggestion from @ncooke3
2026-08-04 14:49:15 -04:00
Nick Cooke 9f183ae842 chore: bump podspec versiona and add changelog note (#241) 2026-06-25 15:48:35 -04:00
Paul Beusterien c46e5f8b7c Update podspec for 8.1.1 (#231) 2026-04-10 08:36:48 -07:00
Nick Cooke 60da361632 [Release] Add changelog and bump podspec bump following #220 (#222) 2025-05-01 15:39:12 -04:00
Andrew Heard 53156c7ec2 [v8.0.2] Update GoogleUtilities.podspec version (#209) 2024-08-09 11:41:53 -04:00
Nick Cooke 66dd81c729 [v8.0.1] Update GoogleUtilities.podspec (#206)
* [v8.0.1] Update GoogleUtilities.podspec

* Add copyright to GoogleUtilities/Privacy/Empty.swift

* Add changelog entry

skip-ci
2024-07-25 15:16:38 -04:00
Andrew Heard 6ba4fa9ff3 Revert "Add OSLog to podspec (#201)" (#204)
This reverts commit 493b5a0d33.
2024-07-11 13:18:17 -07:00
Paul Beusterien 493b5a0d33 Add OSLog to podspec (#201) 2024-07-11 10:34:14 -07:00
Paul Beusterien 8a0d06d06a [v8] Migrate ISASwizzler to Firebase Performance (#190) 2024-06-17 11:08:48 -07:00
Nick Cooke 2771466dfa [v8] Remove dependency on the Promises SDK (#187)
* [v8] Replace read keychain API with completion handler based API (#182)

* [v8] Replace write keychain API with completion handler based API (#183)

* [v8] Replace remove keychain API with completion handler based API (#184)

* [v8] Replace remove keychain API with completion handler based API

* Update GoogleUtilities/Environment/SecureStorage/GULKeychainStorage.m

* [v8] Fix tests, docs, and imports following `GULKeychainStorage` API changes (#185)

* [v8] Remove Promises API and dependency specifications (#186)

* [v8] Remove Promises API and dependency specifications

* Remove other header

* [v8] Add changelog for removal of Promises dependency

* [v8] Remove extraneous parameter from removeObject API (#188)
2024-06-11 17:12:48 -04:00
Paul Beusterien fe0ef88ebb [v8] Update platform minimums and remove GULSecureCoding (#180) 2024-06-06 07:34:58 -07:00
Andrew Heard 3563e16bc5 Bump podspec to 8.0.0 (#174) 2024-05-23 17:48:33 -04:00
Nick Cooke 57a1d307f4 [Release] Prep changelog for upcoming release and bump podspec (#156)
* [Release] Prep changelog for upcoming release

* Bump to 7.13.3
2024-05-08 15:27:57 -04:00
Nick Cooke 8e5d57ed87 [UserDefaults] Remove delayed synchronization (#148)
* [UserDefaults] Remove delayed synchronization

* Bump podspec

* Revert "[UserDefaults] Remove delayed synchronization"

This reverts commit dce15d170f.

* Revert "Revert "[UserDefaults] Remove delayed synchronization""

This reverts commit 0eacd37134.

* Remove unused variable

* Add changelog entry
2024-04-23 17:56:27 -04:00
Nick Cooke 830ffa9276 [Release] Bump spec to 7.13.0 and add changelog entry (#145) 2024-02-15 20:31:55 -05:00
Nick Cooke f9f5058a9d [GoogleUtilities] Add privacy manifest for SPM / CocoaPods (#144)
* [Draft] Test resource bundles and podspecs

* Fix dummy resource

* Add core subspec to expose resource bundle

* [GoogleUtilities] Add privacy manifest for SPM / CocoaPods

* Fix spacing in podspec

* fix target name

* Style

* Fix CI

* wrap text in comment

* Style
2024-02-15 20:31:38 -05:00
Andrew Heard f6532c8d65 [Release] Update podspec and changelog for 7.12.0 release (#139) 2023-11-06 19:00:57 -05:00
Andrew Heard e5715eba0e [Release] Update podspec and changelog for 7.11.6 release (#134) 2023-10-17 10:55:07 -04:00
vprajeetreddy-404andPrajeetReddy Vakiti 75202cc50f Changing podspec file's license from Apache to Apache-2.0 (#121)
Co-authored-by: PrajeetReddy Vakiti <prajeetv@amazon.com>
2023-08-10 16:54:41 -04:00
Nick Cooke 406c461ae8 [Infra] Move third_party code into its own directory (#118)
* [Infra] Setup third_party dir. structure

* Alt. approach with third_party dir at root

* Undo accidental target name change

* Fix remaining accidental changes

* Style

* Add import

* Fix syntax error in podspec

* Style, again

* Remove maybe? unneeded import and change order

* Fix warning

* Replace Google copyright in .h and .m

* Rename references from 'third_party/Environment' to 'third_party/IsAppEncrypted'

* Actually rename 'third_party/Environment/ -> third_party/IsAppEncrypted/'

* Add back void

* Remove extra text from LICENSE
2023-08-07 11:34:27 -04:00
Nick Cooke c38ce365d7 [Release] Update podspec and changelog for 7.11.5 release (#117)
* [Release] Update podspec and changelog for 7.11.5 release

* Add changelog entry for 7.11.5 release
2023-07-27 12:21:05 -04:00
Nick Cooke 4446686bc3 [Release] Update podspec and changelog for 7.11.4 release (#115)
* [Release] Update CHANGELOGs for 7.11.4 release

* [Release] Update podspec for 7.11.4 release

* Change punctuation order to be consistent with out entries
2023-07-18 13:10:15 -04:00
Paul Beusterien 871d431359 Fix Xcode 14.3 build warnings (#104) 2023-04-03 08:21:51 -07:00
Paul Beusterien 0543562f85 7.11.0 CHANGELOG and version update (#101) 2023-01-05 14:35:40 -08:00
Sam Edson 4d0d4b8648 Fix watchOS builds from CoreTelephony include (#95) 2022-11-07 17:24:19 -05:00
Charlotte Liang 17bb6a5d4d update changelog for 7.10.0 release (#94) 2022-11-07 14:23:28 -08:00
Sam Edson b4d138d7e1 Add Network Utilities to GoogleUtilities (#91) 2022-11-07 15:36:44 -05:00
Nick Cooke 878aded666 [v7.8.0] Bump podspec version for 7.8.0 release (#78) 2022-08-26 09:22:23 -04:00
Paul Beusterien b3bb0c5551 Prep for 7.7.0 (#67) 2022-01-06 10:43:14 -08:00
Ryan Wilson 2df906b2c1 Add proper model parsing for macOS and Catalyst. (#59) 2021-10-14 11:35:36 -07:00
Nick Cooke 960dc41df1 Bump podspec for 7.5.2 integration testing (#54) 2021-08-31 22:10:32 -04:00
Maksym Malyhin 2e364ff22e GULHeartbeatDateStorage: avoid using NSFileCoordinator (#51)
* GULHeartbeatDateStorage: use dispatch queue instead of NSFileCoordinator for synchronization

* Concurrency tests

* Adjust concurrency tests

* style

* Use @synchronized(self.class) instead of a dispatch queue

* Fix "unused variable" warnings

* Changelog

* Comment

* Update podspec version

* GULHeartbeatDateStorageTest: Cleanup before testing as well

* Replace expectations with dispatch_barrier_sync to workaround Catalyst test app issue

* style
2021-08-16 18:06:59 -04:00
Nick Cooke beb713a16b Fix CHANGELOG.md & Fix #46's spec bump (#47)
* Update CHANGELOG.md

* Bump to minor and fix CHANGELOG
2021-07-08 14:32:12 -07:00
Nick Cooke 7df9cd01e7 Bump promises dependency (#46)
* Bump promises dependency

* Fix podspec

* Fix package manifest

* CHANGELOG
2021-07-08 16:42:33 -04:00
Nick Cooke 94f9ab80d3 Prep for 7.4.3 release (#44)
* Prep for 7.4.3 release

* Add SwiftPM 7.4.2 release note

* whitespace...

* more whitespace :/
2021-06-23 19:33:28 -04:00
Nick Cooke b184ac2cc2 Update spec for 7.4.2 release (#43) 2021-06-22 19:38:18 -04:00
Nick CookeandMaksym Malyhin 58359415d4 Fix crashes where setHeartbeatDate:forTag: reads immutable dictionary. (#37)
* Unsuccessful repro attempt

* Reproduced 8047 crash

* Fix hb issue related to 7.4 release

* Edit tests

* Update CHANGELOG

* Remove whitespace from CHANGELOG

* Review

* Review 2

* Update GULHeartbeatDateStorageTest.m

* Update comment

* Add tests for unexpected types

* Update podspec

* Date validation

* Add tests for issue fix and type validation

* Use bracket syntax

* Add compatibility tests

* Add compatibility tests revision

* Fix CI

* Fix CI 2

* Fix CI 3

* Re-add files through Xcode UI

* Revert "Re-add files through Xcode UI"

This reverts commit 44110e6ba9.

* Add new files to ARC files list in the test spec

* Uncomment validation failed due to disabled ARC

Co-authored-by: Maksym Malyhin <mmaksym@google.com>
2021-05-10 20:48:57 -04:00
Ryan Wilson 01116e8b6f Introduce UserDefaults based heartbeat storage. (#23)
* Introduce UserDefaults based heartbeat storage.

This can be used on tvOS without fear of losing data between launches.
Clients will need to instantiate the class of their choice, then can use the
`GULHeartbeatDateStorable` protocol if they want to mix and match.

* Fix PR number in CHANGELOG

* Style.sh

* Bump version in podspec.

* Renamed files appropriately

* Copyright fixes
2021-04-13 15:18:20 -04:00
Nick Cooke 36fe49a5c2 Update podspec version to 7.3.2 (#21) 2021-04-12 16:09:53 -04:00
Maksym Malyhin 539493bf0c Add explicit dependency on Security framework to Environment subspec (#12)
* Add explicit dependency on Security framework to Environment subspec

* Bump podspec version

* Changelog
2021-03-15 12:58:37 -04:00
Ryan Wilson 1c47ea1353 Bump version for M91 (#11) 2021-03-03 13:28:33 -05:00
Paul Beusterien 2c7d33099a Fix Xcode 12.5 build warnings (#8) 2021-02-03 07:06:49 -08:00
Paul Beusterien ad9de47554 Swift Package Manager port and test setup (#2) 2021-01-15 17:00:13 -08:00
Paul Beusterien c203c1a43b Initial GitHub Actions (#1) 2021-01-14 07:55:44 -08:00
Gran d1cc61cb16 Add test coverage to podspecs. (#7228) 2020-12-30 12:50:32 -08:00
Maksym Malyhin d13d25f55f GUL: make NSURLSession promise extension public (#7097)
* GUL: make NSURLSession promise extension public

* GUL minor version bump to 7.2.0

* changelog
2020-12-04 15:56:35 -05:00
Paul Beusterien c8893f3fcd Fix unrecognized selector for isiOSAppOnMac on early iOS 14 betas (#6987) 2020-11-17 16:27:42 -08:00
841feebb23 Merge release 7.1.0 (#6944)
* Update versions for Release 7.1.0

* 7.1.0 update version of close source podspecs

* Release 7.1.0 cherry picks (#6917)

* FCM: Fix crash on iOS 14 when multiple app delegate completion methods are called (#6863)

* Fix crash on iOS 14 when multiple completion methods are called

* Fixed lint

* Addressed the PR comments & implemented unit tests

* Reverted auto-extracted method

* Re-organized tests

* Added completion handler for FIRAuth

* Manifest: GDT 8.0.1

* Update Changelogs for 7.1.0 (#6913)

* Changelogs

Co-authored-by: Mike Gerasimenko <github@gerasimenko.me>
Co-authored-by: Paul Beusterien <paulbeusterien@google.com>

* Bump GDT podspec version to 8.0.1

* 7.1.0 SPM Analytics (#6933)

* Carthage update 7.1.0 (#6943)

Co-authored-by: Mike Gerasimenko <github@gerasimenko.me>
Co-authored-by: Paul Beusterien <paulbeusterien@google.com>
2020-11-11 09:25:42 -05:00