Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deprecation warnings): Fix deprecation warnings #301

Merged
merged 7 commits into from
Oct 20, 2020

Conversation

JanNash
Copy link
Contributor

@JanNash JanNash commented Oct 19, 2020

Summary

This PR

  • fixes deprecation warnings for iOS 12.0 and 13.0, tvOS 11.0
  • adds a diagnostic ignored around the usage of the function CC_MD5, which was deprecated in iOS 13.0 but is only used for the checksum field, thus it should be fine to silence the warning

Checklist

  • Does your PR title have the correct title format?
  • Does your PR have a breaking change?: no

As mentioned by @haoliu-amp in
amplitude#250 (comment),
> This crypto algorithm is used for our checksum field, actually you don't need to worry about the security concern for that.
> However, we will see if we wanna switch it to SHA256.
Based on this, we can silence the compile warning here until a fix is implemented.
@JanNash
Copy link
Contributor Author

JanNash commented Oct 19, 2020

The tvOS test testMergeEventsAndIdentifys failed, have you possibly seen this error before?

2020-10-19 21:27:46.195269+0000 xctest[1289:15132] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'No partial mock for object 0x7f8a77e8e4b0'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007fff207526ce __exceptionPreprocess + 242
	1   libobjc.A.dylib                     0x00007fff20090f78 objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff207525ac -[NSException initWithCoder:] + 0
	3   Amplitude_tvOSTests                 0x0000000109351f4f -[OCPartialMockObject classForRealObject] + 95
	4   libobjc.A.dylib                     0x00007fff200a7ce2 -[NSObject isKindOfClass:] + 22
	5   CFNetwork                           0x00007fff20d516f3 _CFHTTPMessageSetResponseProxyURL + 16465
	6   CFNetwork                           0x00007fff20d4f9d8 _CFHTTPMessageSetResponseProxyURL + 9014
	7   libdispatch.dylib                   0x00007fff2017e35b _dispatch_call_block_and_release + 12
	8   libdispatch.dylib                   0x00007fff2017f534 _dispatch_client_callout + 8
	9   libdispatch.dylib                   0x00007fff20185425 _dispatch_lane_serial_drain + 715
	10  libdispatch.dylib                   0x00007fff20185fd7 _dispatch_lane_invoke + 458
	11  libdispatch.dylib                   0x00007fff20190591 _dispatch_workloop_worker_thread + 782
	12  libsystem_pthread.dylib             0x00007fff49ca8a3d _pthread_wqthread + 290
	13  libsystem_pthread.dylib             0x00007fff49ca7b77 start_wqthread + 15
)
libc++abi.dylib: terminating with uncaught exception of type NSException
2020-10-19 21:28:01.818 xcodebuild[1084:11509]  IDETestOperationsObserverDebug: Writing diagnostic log for test session to:
/Users/runner/Library/Developer/Xcode/DerivedData/Amplitude-bviytnhbmawyrdhbsphnwdwgqweg/Logs/Test/Test-Amplitude_tvOS-2020.10.19_21-27-24-+0000.xcresult/Staging/1_Test/Diagnostics/Amplitude_tvOSTests-E699FF2F-220F-463E-95F6-29097875C9C6/Amplitude_tvOSTests-3B38C976-66A4-406C-8E00-E0029DA83A80/Session-Amplitude_tvOSTests-2020-10-19_212801-gHOQMi.log
2020-10-19 21:28:01.818 xcodebuild[1084:11271] [MT] IDETestOperationsObserverDebug: (5C9A4B37-1E91-4B83-921B-0F158F9CFDF5) Beginning test session Amplitude_tvOSTests-5C9A4B37-1E91-4B83-921B-0F158F9CFDF5 at 2020-10-19 21:28:01.818 with Xcode 12A7209 on target <DVTiPhoneSimulator: 0x7fabc620c8b0> {
		SimDevice: Apple TV (DF6775A2-7B9F-4DC9-B3A0-7050A6D96E5A, tvOS 14.0, Booted)
} (14.0 (18J383))
2020-10-19 21:28:01.820 xcodebuild[1084:11271] [MT] IDETestOperationsObserverDebug: (5C9A4B37-1E91-4B83-921B-0F158F9CFDF5) Finished requesting crash reports. Continuing with testing.

Restarting after unexpected exit, crash, or test timeout in AmplitudeTests/testMergeEventsAndIdentifys; summary will include totals from previous launches.

@haoliu-amp
Copy link
Contributor

@JanNash We do see some flaky tests after refining our build pipelines. We're working on fixing them.

@jooohhn Could you take a look when you get a chance?

Copy link
Contributor

@haoliu-amp haoliu-amp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only one nit, others lgtm.

Sources/Amplitude/AMPUtils.m Outdated Show resolved Hide resolved
@haoliu-amp haoliu-amp merged commit e7b0e6e into amplitude:master Oct 20, 2020
@JanNash JanNash deleted the fix-iOS-14-deprecation-warnings branch October 20, 2020 16:39
github-actions bot pushed a commit that referenced this pull request Oct 20, 2020
## [7.1.1](v7.1.0...v7.1.1) (2020-10-20)

### Bug Fixes

* **buildsettings:** Remove override for GCC_WARN_INHIBIT_ALL_WARNINGS ([#302](#302)) ([0e55297](0e55297))
* **deprecation warnings:** Fix deprecation warnings ([#301](#301)) ([e7b0e6e](e7b0e6e)), closes [/github.com//issues/250#issuecomment-655224554](https://github.com//github.com/amplitude/Amplitude-iOS/issues/250/issues/issuecomment-655224554)
* **deprecations:** Use DEPRECATED_MSG_ATTRIBUTE instead of notes ([#305](#305)) ([f501c6c](f501c6c))
* nil dynamic config refresh crash ([#288](#288)) ([#289](#289)) ([9dc896d](9dc896d))
* Swift UserId and DeviceId setter ([#299](#299)) ([b7c0f90](b7c0f90))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants