فهرست منبع

rollback Real 5.0.3

marinofaggiana 4 سال پیش
والد
کامیت
73cf5fd1eb
67فایلهای تغییر یافته به همراه639 افزوده شده و 1130 حذف شده
  1. 1 1
      Cartfile
  2. 1 1
      Cartfile.resolved
  3. 0 2
      Carthage/Checkouts/realm-cocoa/.gitignore
  4. 303 186
      Carthage/Checkouts/realm-cocoa/.jenkins.yml
  5. 1 1
      Carthage/Checkouts/realm-cocoa/.travis.yml
  6. 0 196
      Carthage/Checkouts/realm-cocoa/CHANGELOG.md
  7. 2 13
      Carthage/Checkouts/realm-cocoa/Configuration/Base.xcconfig
  8. 1 1
      Carthage/Checkouts/realm-cocoa/Configuration/Realm/Realm iOS static.xcconfig
  9. 1 1
      Carthage/Checkouts/realm-cocoa/Configuration/Realm/Tests iOS static.xcconfig
  10. 1 1
      Carthage/Checkouts/realm-cocoa/Configuration/TestHost.xcconfig
  11. 7 2
      Carthage/Checkouts/realm-cocoa/Jenkinsfile.releasability
  12. 1 1
      Carthage/Checkouts/realm-cocoa/Realm.podspec
  13. 0 97
      Carthage/Checkouts/realm-cocoa/Realm/ObjectServerTests/RLMObjectServerTests.mm
  14. 0 30
      Carthage/Checkouts/realm-cocoa/Realm/ObjectServerTests/RLMPermissionsAPITests.m
  15. 0 6
      Carthage/Checkouts/realm-cocoa/Realm/ObjectServerTests/RLMSyncTestCase.h
  16. 1 45
      Carthage/Checkouts/realm-cocoa/Realm/ObjectServerTests/RLMSyncTestCase.mm
  17. 3 2
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/CMake/CodeCoverage.cmake
  18. 3 3
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/CMake/RealmCore.cmake
  19. 17 17
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/Jenkinsfile
  20. 2 2
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/dependencies.list
  21. 2 10
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/src/impl/results_notifier.cpp
  22. 0 17
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/src/object.cpp
  23. 0 1
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/src/object.hpp
  24. 47 58
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/src/object_accessor.hpp
  25. 0 13
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/src/property.hpp
  26. 15 5
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/src/thread_safe_reference.cpp
  27. 0 3
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/src/thread_safe_reference.hpp
  28. 2 206
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/tests/migrations.cpp
  29. 0 10
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/tests/results.cpp
  30. 0 10
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/tests/thread_safe_reference.cpp
  31. 1 1
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/tests/util/test_file.hpp
  32. 7 2
      Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/workflow/test_coverage.sh
  33. 1 1
      Carthage/Checkouts/realm-cocoa/Realm/RLMRealm+Sync.h
  34. 1 1
      Carthage/Checkouts/realm-cocoa/Realm/RLMRealm.h
  35. 1 6
      Carthage/Checkouts/realm-cocoa/Realm/RLMRealm.mm
  36. 1 1
      Carthage/Checkouts/realm-cocoa/Realm/RLMRealmConfiguration+Sync.h
  37. 7 17
      Carthage/Checkouts/realm-cocoa/Realm/RLMRealmConfiguration.h
  38. 4 16
      Carthage/Checkouts/realm-cocoa/Realm/RLMRealmConfiguration.mm
  39. 1 1
      Carthage/Checkouts/realm-cocoa/Realm/RLMSyncCredentials.h
  40. 1 1
      Carthage/Checkouts/realm-cocoa/Realm/RLMSyncManager.h
  41. 1 1
      Carthage/Checkouts/realm-cocoa/Realm/RLMSyncSession.h
  42. 0 15
      Carthage/Checkouts/realm-cocoa/Realm/RLMSyncSession.mm
  43. 3 3
      Carthage/Checkouts/realm-cocoa/Realm/RLMSyncUser.h
  44. 2 2
      Carthage/Checkouts/realm-cocoa/Realm/Realm-Info.plist
  45. 0 2
      Carthage/Checkouts/realm-cocoa/Realm/Tests/KVOTests.mm
  46. 0 1
      Carthage/Checkouts/realm-cocoa/Realm/Tests/MigrationTests.mm
  47. 0 21
      Carthage/Checkouts/realm-cocoa/Realm/Tests/RealmTests.mm
  48. 1 1
      Carthage/Checkouts/realm-cocoa/RealmSwift.podspec
  49. 70 0
      Carthage/Checkouts/realm-cocoa/RealmSwift/List.swift
  50. 2 0
      Carthage/Checkouts/realm-cocoa/RealmSwift/Optional.swift
  51. 13 15
      Carthage/Checkouts/realm-cocoa/RealmSwift/RealmConfiguration.swift
  52. 2 0
      Carthage/Checkouts/realm-cocoa/RealmSwift/Results.swift
  53. 14 14
      Carthage/Checkouts/realm-cocoa/RealmSwift/Tests/KVOTests.swift
  54. 10 2
      Carthage/Checkouts/realm-cocoa/RealmSwift/Tests/ListTests.swift
  55. 2 2
      Carthage/Checkouts/realm-cocoa/RealmSwift/Tests/PrimitiveListTests.swift
  56. 13 13
      Carthage/Checkouts/realm-cocoa/RealmSwift/Tests/RealmTests.swift
  57. 11 11
      Carthage/Checkouts/realm-cocoa/RealmSwift/Tests/TestCase.swift
  58. 39 16
      Carthage/Checkouts/realm-cocoa/build.sh
  59. 3 3
      Carthage/Checkouts/realm-cocoa/dependencies.list
  60. 8 10
      Carthage/Checkouts/realm-cocoa/examples/installation/build.sh
  61. 1 1
      Carthage/Checkouts/realm-cocoa/examples/installation/ios/objc/CocoaPodsDynamicExample/Podfile
  62. 1 1
      Carthage/Checkouts/realm-cocoa/examples/installation/ios/objc/CocoaPodsExample/Podfile
  63. 1 1
      Carthage/Checkouts/realm-cocoa/examples/installation/ios/swift/CocoaPodsExample/Podfile
  64. 1 1
      Carthage/Checkouts/realm-cocoa/examples/ios/objc/Podfile
  65. 1 1
      Carthage/Checkouts/realm-cocoa/scripts/package_examples.rb
  66. 3 5
      Carthage/Checkouts/realm-cocoa/scripts/reset-simulators.rb
  67. 1 0
      iOSClient/Supporting Files/en.lproj/Localizable.strings

+ 1 - 1
Cartfile

@@ -4,7 +4,7 @@ github "kishikawakatsumi/UICKeyChainStore" "v2.1.2"
 github "MortimerGoro/MGSwipeTableCell" "1.6.8"
 github "dzenbot/DZNEmptyDataSet" "v1.8.1"
 github "jdg/MBProgressHUD" "1.1.0"
-github "realm/realm-cocoa" "v5.3.3"
+github "realm/realm-cocoa" "v5.0.3"
 github "SVGKit/SVGKit" "3.x"
 github "WeTransfer/WeScan" "1.2.0"
 github "malcommac/SwiftRichString"

+ 1 - 1
Cartfile.resolved

@@ -19,7 +19,7 @@ github "malcommac/SwiftRichString" "3.7.2"
 github "marinofaggiana/KTVHTTPCache" "2.0.2"
 github "marinofaggiana/TOPasscodeViewController" "0.0.7"
 github "nextcloud/ios-communication-library" "v0.75"
-github "realm/realm-cocoa" "v5.3.3"
+github "realm/realm-cocoa" "v5.0.3"
 github "rechsteiner/Parchment" "v2.4.0"
 github "scenee/FloatingPanel" "v1.7.5"
 github "tilltue/TLPhotoPicker" "2.0.12"

+ 0 - 2
Carthage/Checkouts/realm-cocoa/.gitignore

@@ -117,5 +117,3 @@ Realm/ObjectServerTests/node_modules
 .swiftpm
 .build
 Package.resolved
-
-examples/installation/ios/swift/SwiftPackageManagerExample/SwiftPackageManagerExample.xcodeproj

+ 303 - 186
Carthage/Checkouts/realm-cocoa/.jenkins.yml

@@ -4,11 +4,12 @@
 # This is a generated file produced by scripts/pr-ci-matrix.rb.
 
 xcode_version: 
+ - 10.3
+ - 11.1
+ - 11.2.1
  - 11.3
  - 11.4.1
  - 11.5
- - 11.6
- - 12.0
 target: 
  - docs
  - swiftlint
@@ -39,686 +40,802 @@ configuration:
 
 exclude:
 
-  - xcode_version: 11.3
+  - xcode_version: 10.3
     target: docs
     configuration: Debug
 
-  - xcode_version: 11.3
+  - xcode_version: 10.3
     target: docs
     configuration: Release
 
-  - xcode_version: 11.4.1
+  - xcode_version: 11.1
     target: docs
     configuration: Debug
 
-  - xcode_version: 11.4.1
+  - xcode_version: 11.1
     target: docs
     configuration: Release
 
-  - xcode_version: 11.5
+  - xcode_version: 11.2.1
     target: docs
     configuration: Debug
 
-  - xcode_version: 11.5
+  - xcode_version: 11.2.1
     target: docs
     configuration: Release
 
-  - xcode_version: 11.6
+  - xcode_version: 11.3
     target: docs
     configuration: Debug
 
-  - xcode_version: 11.6
+  - xcode_version: 11.3
     target: docs
     configuration: Release
 
-  - xcode_version: 12.0
+  - xcode_version: 11.4.1
     target: docs
     configuration: Debug
 
-  - xcode_version: 11.3
-    target: swiftlint
-    configuration: Debug
-
-  - xcode_version: 11.3
-    target: swiftlint
+  - xcode_version: 11.4.1
+    target: docs
     configuration: Release
 
-  - xcode_version: 11.4.1
+  - xcode_version: 11.5
+    target: docs
+    configuration: Debug
+
+  - xcode_version: 10.3
     target: swiftlint
     configuration: Debug
 
-  - xcode_version: 11.4.1
+  - xcode_version: 10.3
     target: swiftlint
     configuration: Release
 
-  - xcode_version: 11.5
+  - xcode_version: 11.1
     target: swiftlint
     configuration: Debug
 
-  - xcode_version: 11.5
+  - xcode_version: 11.1
     target: swiftlint
     configuration: Release
 
-  - xcode_version: 11.6
+  - xcode_version: 11.2.1
     target: swiftlint
     configuration: Debug
 
-  - xcode_version: 11.6
+  - xcode_version: 11.2.1
     target: swiftlint
     configuration: Release
 
-  - xcode_version: 12.0
+  - xcode_version: 11.3
     target: swiftlint
     configuration: Debug
 
   - xcode_version: 11.3
-    target: osx-encryption
-    configuration: Debug
+    target: swiftlint
+    configuration: Release
 
   - xcode_version: 11.4.1
-    target: osx-encryption
+    target: swiftlint
     configuration: Debug
 
   - xcode_version: 11.4.1
-    target: osx-encryption
+    target: swiftlint
     configuration: Release
 
   - xcode_version: 11.5
+    target: swiftlint
+    configuration: Debug
+
+  - xcode_version: 10.3
     target: osx-encryption
     configuration: Debug
 
-  - xcode_version: 11.5
+  - xcode_version: 11.1
+    target: osx-encryption
+    configuration: Debug
+
+  - xcode_version: 11.1
     target: osx-encryption
     configuration: Release
 
-  - xcode_version: 11.6
+  - xcode_version: 11.2.1
     target: osx-encryption
     configuration: Debug
 
-  - xcode_version: 11.6
+  - xcode_version: 11.2.1
     target: osx-encryption
     configuration: Release
 
-  - xcode_version: 12.0
+  - xcode_version: 11.3
     target: osx-encryption
     configuration: Debug
 
   - xcode_version: 11.3
-    target: osx-object-server
-    configuration: Debug
+    target: osx-encryption
+    configuration: Release
 
   - xcode_version: 11.4.1
-    target: osx-object-server
+    target: osx-encryption
     configuration: Debug
 
   - xcode_version: 11.4.1
-    target: osx-object-server
+    target: osx-encryption
     configuration: Release
 
   - xcode_version: 11.5
+    target: osx-encryption
+    configuration: Debug
+
+  - xcode_version: 10.3
     target: osx-object-server
     configuration: Debug
 
-  - xcode_version: 11.5
+  - xcode_version: 11.1
+    target: osx-object-server
+    configuration: Debug
+
+  - xcode_version: 11.1
     target: osx-object-server
     configuration: Release
 
-  - xcode_version: 11.6
+  - xcode_version: 11.2.1
     target: osx-object-server
     configuration: Debug
 
-  - xcode_version: 11.6
+  - xcode_version: 11.2.1
     target: osx-object-server
     configuration: Release
 
-  - xcode_version: 12.0
+  - xcode_version: 11.3
     target: osx-object-server
     configuration: Debug
 
   - xcode_version: 11.3
-    target: ios-static
-    configuration: Debug
+    target: osx-object-server
+    configuration: Release
 
   - xcode_version: 11.4.1
-    target: ios-static
+    target: osx-object-server
     configuration: Debug
 
   - xcode_version: 11.4.1
-    target: ios-static
+    target: osx-object-server
     configuration: Release
 
   - xcode_version: 11.5
+    target: osx-object-server
+    configuration: Debug
+
+  - xcode_version: 10.3
     target: ios-static
     configuration: Debug
 
-  - xcode_version: 11.5
+  - xcode_version: 11.1
+    target: ios-static
+    configuration: Debug
+
+  - xcode_version: 11.1
     target: ios-static
     configuration: Release
 
-  - xcode_version: 11.6
+  - xcode_version: 11.2.1
     target: ios-static
     configuration: Debug
 
-  - xcode_version: 11.6
+  - xcode_version: 11.2.1
     target: ios-static
     configuration: Release
 
-  - xcode_version: 12.0
+  - xcode_version: 11.3
     target: ios-static
     configuration: Debug
 
   - xcode_version: 11.3
-    target: ios-dynamic
-    configuration: Debug
+    target: ios-static
+    configuration: Release
 
   - xcode_version: 11.4.1
-    target: ios-dynamic
+    target: ios-static
     configuration: Debug
 
   - xcode_version: 11.4.1
-    target: ios-dynamic
+    target: ios-static
     configuration: Release
 
   - xcode_version: 11.5
+    target: ios-static
+    configuration: Debug
+
+  - xcode_version: 10.3
     target: ios-dynamic
     configuration: Debug
 
-  - xcode_version: 11.5
+  - xcode_version: 11.1
+    target: ios-dynamic
+    configuration: Debug
+
+  - xcode_version: 11.1
     target: ios-dynamic
     configuration: Release
 
-  - xcode_version: 11.6
+  - xcode_version: 11.2.1
     target: ios-dynamic
     configuration: Debug
 
-  - xcode_version: 11.6
+  - xcode_version: 11.2.1
     target: ios-dynamic
     configuration: Release
 
-  - xcode_version: 12.0
+  - xcode_version: 11.3
     target: ios-dynamic
     configuration: Debug
 
   - xcode_version: 11.3
-    target: watchos
-    configuration: Debug
+    target: ios-dynamic
+    configuration: Release
 
   - xcode_version: 11.4.1
-    target: watchos
+    target: ios-dynamic
     configuration: Debug
 
   - xcode_version: 11.4.1
-    target: watchos
+    target: ios-dynamic
     configuration: Release
 
   - xcode_version: 11.5
+    target: ios-dynamic
+    configuration: Debug
+
+  - xcode_version: 10.3
     target: watchos
     configuration: Debug
 
-  - xcode_version: 11.5
+  - xcode_version: 11.1
+    target: watchos
+    configuration: Debug
+
+  - xcode_version: 11.1
     target: watchos
     configuration: Release
 
-  - xcode_version: 11.6
+  - xcode_version: 11.2.1
     target: watchos
     configuration: Debug
 
-  - xcode_version: 11.6
+  - xcode_version: 11.2.1
     target: watchos
     configuration: Release
 
-  - xcode_version: 12.0
+  - xcode_version: 11.3
     target: watchos
     configuration: Debug
 
   - xcode_version: 11.3
-    target: tvos
-    configuration: Debug
+    target: watchos
+    configuration: Release
 
   - xcode_version: 11.4.1
-    target: tvos
+    target: watchos
     configuration: Debug
 
   - xcode_version: 11.4.1
-    target: tvos
+    target: watchos
     configuration: Release
 
   - xcode_version: 11.5
+    target: watchos
+    configuration: Debug
+
+  - xcode_version: 10.3
     target: tvos
     configuration: Debug
 
-  - xcode_version: 11.5
+  - xcode_version: 11.1
+    target: tvos
+    configuration: Debug
+
+  - xcode_version: 11.1
     target: tvos
     configuration: Release
 
-  - xcode_version: 11.6
+  - xcode_version: 11.2.1
     target: tvos
     configuration: Debug
 
-  - xcode_version: 11.6
+  - xcode_version: 11.2.1
     target: tvos
     configuration: Release
 
-  - xcode_version: 12.0
+  - xcode_version: 11.3
     target: tvos
     configuration: Debug
 
   - xcode_version: 11.3
-    target: ios-swift
-    configuration: Debug
+    target: tvos
+    configuration: Release
 
   - xcode_version: 11.4.1
-    target: ios-swift
+    target: tvos
     configuration: Debug
 
   - xcode_version: 11.4.1
-    target: ios-swift
+    target: tvos
     configuration: Release
 
   - xcode_version: 11.5
+    target: tvos
+    configuration: Debug
+
+  - xcode_version: 10.3
     target: ios-swift
     configuration: Debug
 
-  - xcode_version: 11.5
+  - xcode_version: 11.1
+    target: ios-swift
+    configuration: Debug
+
+  - xcode_version: 11.1
     target: ios-swift
     configuration: Release
 
-  - xcode_version: 11.6
+  - xcode_version: 11.2.1
     target: ios-swift
     configuration: Debug
 
-  - xcode_version: 11.6
+  - xcode_version: 11.2.1
     target: ios-swift
     configuration: Release
 
-  - xcode_version: 12.0
+  - xcode_version: 11.3
     target: ios-swift
     configuration: Debug
 
   - xcode_version: 11.3
-    target: tvos-swift
-    configuration: Debug
+    target: ios-swift
+    configuration: Release
 
   - xcode_version: 11.4.1
-    target: tvos-swift
+    target: ios-swift
     configuration: Debug
 
   - xcode_version: 11.4.1
-    target: tvos-swift
+    target: ios-swift
     configuration: Release
 
   - xcode_version: 11.5
+    target: ios-swift
+    configuration: Debug
+
+  - xcode_version: 10.3
     target: tvos-swift
     configuration: Debug
 
-  - xcode_version: 11.5
+  - xcode_version: 11.1
+    target: tvos-swift
+    configuration: Debug
+
+  - xcode_version: 11.1
     target: tvos-swift
     configuration: Release
 
-  - xcode_version: 11.6
+  - xcode_version: 11.2.1
     target: tvos-swift
     configuration: Debug
 
-  - xcode_version: 11.6
+  - xcode_version: 11.2.1
     target: tvos-swift
     configuration: Release
 
-  - xcode_version: 12.0
+  - xcode_version: 11.3
     target: tvos-swift
     configuration: Debug
 
   - xcode_version: 11.3
-    target: catalyst
-    configuration: Debug
+    target: tvos-swift
+    configuration: Release
 
   - xcode_version: 11.4.1
-    target: catalyst
+    target: tvos-swift
     configuration: Debug
 
   - xcode_version: 11.4.1
-    target: catalyst
+    target: tvos-swift
     configuration: Release
 
   - xcode_version: 11.5
+    target: tvos-swift
+    configuration: Debug
+
+  - xcode_version: 10.3
     target: catalyst
     configuration: Debug
 
-  - xcode_version: 11.5
+  - xcode_version: 10.3
     target: catalyst
     configuration: Release
 
-  - xcode_version: 11.6
+  - xcode_version: 11.1
     target: catalyst
     configuration: Debug
 
-  - xcode_version: 11.6
-    target: catalyst
-    configuration: Release
-
-  - xcode_version: 12.0
+  - xcode_version: 11.2.1
     target: catalyst
     configuration: Debug
 
   - xcode_version: 11.3
-    target: catalyst-swift
+    target: catalyst
     configuration: Debug
 
   - xcode_version: 11.4.1
+    target: catalyst
+    configuration: Debug
+
+  - xcode_version: 10.3
     target: catalyst-swift
     configuration: Debug
 
-  - xcode_version: 11.4.1
+  - xcode_version: 10.3
     target: catalyst-swift
     configuration: Release
 
-  - xcode_version: 11.5
+  - xcode_version: 11.1
     target: catalyst-swift
     configuration: Debug
 
-  - xcode_version: 11.5
+  - xcode_version: 11.2.1
     target: catalyst-swift
-    configuration: Release
+    configuration: Debug
 
-  - xcode_version: 11.6
+  - xcode_version: 11.3
     target: catalyst-swift
     configuration: Debug
 
-  - xcode_version: 11.6
+  - xcode_version: 11.4.1
     target: catalyst-swift
-    configuration: Release
+    configuration: Debug
 
-  - xcode_version: 12.0
-    target: catalyst-swift
+  - xcode_version: 10.3
+    target: xcframework
     configuration: Debug
 
-  - xcode_version: 11.3
+  - xcode_version: 10.3
+    target: xcframework
+    configuration: Release
+
+  - xcode_version: 11.1
     target: xcframework
     configuration: Debug
 
-  - xcode_version: 11.3
+  - xcode_version: 11.1
     target: xcframework
     configuration: Release
 
-  - xcode_version: 11.4.1
+  - xcode_version: 11.2.1
     target: xcframework
     configuration: Debug
 
-  - xcode_version: 11.4.1
+  - xcode_version: 11.2.1
     target: xcframework
     configuration: Release
 
-  - xcode_version: 11.5
+  - xcode_version: 11.3
     target: xcframework
     configuration: Debug
 
-  - xcode_version: 11.5
+  - xcode_version: 11.3
     target: xcframework
     configuration: Release
 
-  - xcode_version: 11.6
+  - xcode_version: 11.4.1
     target: xcframework
     configuration: Debug
 
-  - xcode_version: 11.6
+  - xcode_version: 11.4.1
     target: xcframework
     configuration: Release
 
-  - xcode_version: 12.0
+  - xcode_version: 11.5
     target: xcframework
     configuration: Debug
 
-  - xcode_version: 11.3
+  - xcode_version: 10.3
     target: cocoapods-osx
     configuration: Debug
 
-  - xcode_version: 11.4.1
+  - xcode_version: 11.1
     target: cocoapods-osx
     configuration: Debug
 
-  - xcode_version: 11.5
+  - xcode_version: 11.2.1
     target: cocoapods-osx
     configuration: Debug
 
-  - xcode_version: 11.6
+  - xcode_version: 11.3
     target: cocoapods-osx
     configuration: Debug
 
-  - xcode_version: 12.0
+  - xcode_version: 11.4.1
     target: cocoapods-osx
     configuration: Debug
 
-  - xcode_version: 11.3
+  - xcode_version: 11.5
+    target: cocoapods-osx
+    configuration: Debug
+
+  - xcode_version: 10.3
     target: cocoapods-ios
     configuration: Debug
 
-  - xcode_version: 11.4.1
+  - xcode_version: 11.1
     target: cocoapods-ios
     configuration: Debug
 
-  - xcode_version: 11.4.1
+  - xcode_version: 11.1
     target: cocoapods-ios
     configuration: Release
 
-  - xcode_version: 11.5
+  - xcode_version: 11.2.1
     target: cocoapods-ios
     configuration: Debug
 
-  - xcode_version: 11.5
+  - xcode_version: 11.2.1
     target: cocoapods-ios
     configuration: Release
 
-  - xcode_version: 11.6
+  - xcode_version: 11.3
     target: cocoapods-ios
     configuration: Debug
 
-  - xcode_version: 11.6
+  - xcode_version: 11.3
     target: cocoapods-ios
     configuration: Release
 
-  - xcode_version: 12.0
+  - xcode_version: 11.4.1
     target: cocoapods-ios
     configuration: Debug
 
-  - xcode_version: 11.3
+  - xcode_version: 11.4.1
+    target: cocoapods-ios
+    configuration: Release
+
+  - xcode_version: 11.5
+    target: cocoapods-ios
+    configuration: Debug
+
+  - xcode_version: 10.3
     target: cocoapods-ios-dynamic
     configuration: Debug
 
-  - xcode_version: 11.4.1
+  - xcode_version: 11.1
     target: cocoapods-ios-dynamic
     configuration: Debug
 
-  - xcode_version: 11.4.1
+  - xcode_version: 11.1
     target: cocoapods-ios-dynamic
     configuration: Release
 
-  - xcode_version: 11.5
+  - xcode_version: 11.2.1
     target: cocoapods-ios-dynamic
     configuration: Debug
 
-  - xcode_version: 11.5
+  - xcode_version: 11.2.1
     target: cocoapods-ios-dynamic
     configuration: Release
 
-  - xcode_version: 11.6
+  - xcode_version: 11.3
     target: cocoapods-ios-dynamic
     configuration: Debug
 
-  - xcode_version: 11.6
+  - xcode_version: 11.3
     target: cocoapods-ios-dynamic
     configuration: Release
 
-  - xcode_version: 12.0
+  - xcode_version: 11.4.1
     target: cocoapods-ios-dynamic
     configuration: Debug
 
-  - xcode_version: 11.3
+  - xcode_version: 11.4.1
+    target: cocoapods-ios-dynamic
+    configuration: Release
+
+  - xcode_version: 11.5
+    target: cocoapods-ios-dynamic
+    configuration: Debug
+
+  - xcode_version: 10.3
     target: cocoapods-watchos
     configuration: Debug
 
-  - xcode_version: 11.4.1
+  - xcode_version: 11.1
     target: cocoapods-watchos
     configuration: Debug
 
-  - xcode_version: 11.4.1
+  - xcode_version: 11.1
     target: cocoapods-watchos
     configuration: Release
 
-  - xcode_version: 11.5
+  - xcode_version: 11.2.1
     target: cocoapods-watchos
     configuration: Debug
 
-  - xcode_version: 11.5
+  - xcode_version: 11.2.1
     target: cocoapods-watchos
     configuration: Release
 
-  - xcode_version: 11.6
+  - xcode_version: 11.3
     target: cocoapods-watchos
     configuration: Debug
 
-  - xcode_version: 11.6
+  - xcode_version: 11.3
     target: cocoapods-watchos
     configuration: Release
 
-  - xcode_version: 12.0
+  - xcode_version: 11.4.1
     target: cocoapods-watchos
     configuration: Debug
 
-  - xcode_version: 11.3
-    target: swiftpm
+  - xcode_version: 11.4.1
+    target: cocoapods-watchos
+    configuration: Release
+
+  - xcode_version: 11.5
+    target: cocoapods-watchos
     configuration: Debug
 
-  - xcode_version: 11.4.1
+  - xcode_version: 10.3
     target: swiftpm
     configuration: Debug
 
-  - xcode_version: 11.4.1
+  - xcode_version: 10.3
     target: swiftpm
     configuration: Release
 
-  - xcode_version: 11.5
+  - xcode_version: 11.1
     target: swiftpm
     configuration: Debug
 
-  - xcode_version: 11.5
+  - xcode_version: 11.2.1
     target: swiftpm
-    configuration: Release
+    configuration: Debug
 
-  - xcode_version: 11.6
+  - xcode_version: 11.3
     target: swiftpm
     configuration: Debug
 
-  - xcode_version: 11.6
+  - xcode_version: 11.4.1
     target: swiftpm
-    configuration: Release
+    configuration: Debug
 
-  - xcode_version: 12.0
-    target: swiftpm
+  - xcode_version: 10.3
+    target: swiftpm-address
     configuration: Debug
 
-  - xcode_version: 11.3
+  - xcode_version: 10.3
+    target: swiftpm-address
+    configuration: Release
+
+  - xcode_version: 11.1
     target: swiftpm-address
     configuration: Debug
 
-  - xcode_version: 11.3
+  - xcode_version: 11.1
     target: swiftpm-address
     configuration: Release
 
-  - xcode_version: 11.4.1
+  - xcode_version: 11.2.1
     target: swiftpm-address
     configuration: Debug
 
-  - xcode_version: 11.4.1
+  - xcode_version: 11.2.1
     target: swiftpm-address
     configuration: Release
 
-  - xcode_version: 11.5
+  - xcode_version: 11.3
     target: swiftpm-address
     configuration: Debug
 
-  - xcode_version: 11.5
+  - xcode_version: 11.3
     target: swiftpm-address
     configuration: Release
 
-  - xcode_version: 11.6
+  - xcode_version: 11.4.1
     target: swiftpm-address
     configuration: Debug
 
-  - xcode_version: 11.6
+  - xcode_version: 11.4.1
     target: swiftpm-address
     configuration: Release
 
-  - xcode_version: 12.0
+  - xcode_version: 11.5
     target: swiftpm-address
     configuration: Debug
 
-  - xcode_version: 11.3
+  - xcode_version: 10.3
     target: swiftpm-thread
     configuration: Debug
 
-  - xcode_version: 11.3
+  - xcode_version: 10.3
     target: swiftpm-thread
     configuration: Release
 
-  - xcode_version: 11.4.1
+  - xcode_version: 11.1
     target: swiftpm-thread
     configuration: Debug
 
-  - xcode_version: 11.4.1
+  - xcode_version: 11.1
     target: swiftpm-thread
     configuration: Release
 
-  - xcode_version: 11.5
+  - xcode_version: 11.2.1
     target: swiftpm-thread
     configuration: Debug
 
-  - xcode_version: 11.5
+  - xcode_version: 11.2.1
     target: swiftpm-thread
     configuration: Release
 
-  - xcode_version: 11.6
+  - xcode_version: 11.3
     target: swiftpm-thread
     configuration: Debug
 
-  - xcode_version: 11.6
+  - xcode_version: 11.3
     target: swiftpm-thread
     configuration: Release
 
-  - xcode_version: 12.0
+  - xcode_version: 11.4.1
     target: swiftpm-thread
     configuration: Debug
 
-  - xcode_version: 11.3
+  - xcode_version: 11.4.1
+    target: swiftpm-thread
+    configuration: Release
+
+  - xcode_version: 11.5
+    target: swiftpm-thread
+    configuration: Debug
+
+  - xcode_version: 10.3
     target: swiftpm-ios
     configuration: Debug
 
-  - xcode_version: 11.3
+  - xcode_version: 10.3
     target: swiftpm-ios
     configuration: Release
 
-  - xcode_version: 11.4.1
+  - xcode_version: 11.1
     target: swiftpm-ios
     configuration: Debug
 
-  - xcode_version: 11.4.1
+  - xcode_version: 11.1
     target: swiftpm-ios
     configuration: Release
 
-  - xcode_version: 11.5
+  - xcode_version: 11.2.1
     target: swiftpm-ios
     configuration: Debug
 
-  - xcode_version: 11.5
+  - xcode_version: 11.2.1
     target: swiftpm-ios
     configuration: Release
 
-  - xcode_version: 11.6
+  - xcode_version: 11.3
     target: swiftpm-ios
     configuration: Debug
 
-  - xcode_version: 11.6
+  - xcode_version: 11.3
     target: swiftpm-ios
     configuration: Release
 
-  - xcode_version: 12.0
+  - xcode_version: 11.4.1
+    target: swiftpm-ios
+    configuration: Debug
+
+  - xcode_version: 11.4.1
+    target: swiftpm-ios
+    configuration: Release
+
+  - xcode_version: 11.5
     target: swiftpm-ios
     configuration: Debug

+ 1 - 1
Carthage/Checkouts/realm-cocoa/.travis.yml

@@ -1,5 +1,5 @@
 language: objective-c
-osx_image: xcode11.6
+osx_image: xcode10.2
 branches:
   only: master
 script: placeholder # workaround for https://github.com/travis-ci/travis-ci/issues/4681

+ 0 - 196
Carthage/Checkouts/realm-cocoa/CHANGELOG.md

@@ -1,199 +1,3 @@
-5.3.3 Release notes (2020-07-30)
-=============================================================
-
-### Enhancements
-
-* Add support for the x86_64 watchOS simulator added in Xcode 12.
-
-### Fixed
-
-* (RLM)Results objects would incorrectly pin old read transaction versions
-  until they were accessed after a Realm was refreshed, resulting in the Realm
-  file growing to large sizes if a Results was retained but not accessed after
-  every write. ([#6677](https://github.com/realm/realm-cocoa/issues/6677), since 5.0.0).
-* Fix linker errors when using SwiftUI previews with Xcode 12 when Realm was
-  installed via Swift Package Manager. ([#6625](https://github.com/realm/realm-cocoa/issues/6625))
-
-### Compatibility
-
-* File format: Generates Realms with format v10 (Reads and upgrades all previous formats)
-* Realm Object Server: 3.21.0 or later.
-* Realm Studio: 3.11 or later.
-* APIs are backwards compatible with all previous releases in the 5.x.y series.
-* Carthage release for Swift is built with Xcode 11.6.
-
-### Internal
-
-* Upgraded realm-core from v6.0.12 to v6.0.14
-* Upgraded realm-sync from v5.0.12 to v5.0.14
-
-5.3.2 Release notes (2020-07-21)
-=============================================================
-
-### Fixed
-
-* Fix a file format upgrade bug when opening older Realm files. Could cause
-  assertions like "Assertion failed: ref != 0" during opning of a Realm.
-  ([Core #6644](https://github.com/realm/realm-cocoa/issues/6644), since 5.2.0)
-* A use-after-free would occur if a Realm was compacted, opened on multiple
-  threads prior to the first write, then written to while reads were happening
-  on other threads. This could result in a variety of crashes, often inside
-  realm::util::EncryptedFileMapping::read_barrier.
-  (Since v5.0.0, [#6626](https://github.com/realm/realm-cocoa/issues/6626),
-  [#6628](https://github.com/realm/realm-cocoa/issues/6628),
-  [#6652](https://github.com/realm/realm-cocoa/issues/6652),
-  [#6655](https://github.com/realm/realm-cocoa/issues/6555),
-  [#6656](https://github.com/realm/realm-cocoa/issues/6656)).
-
-### Compatibility
-
-* File format: Generates Realms with format v10 (Reads and upgrades all previous formats)
-* Realm Object Server: 3.21.0 or later.
-* Realm Studio: 3.11 or later.
-* APIs are backwards compatible with all previous releases in the 5.x.y series.
-* Carthage release for Swift is built with Xcode 11.6.
-
-### Internal
-
-* Upgraded realm-core from v6.0.11 to v6.0.12
-* Upgraded realm-sync from v5.0.11 to v5.0.12
-
-5.3.1 Release notes (2020-07-17)
-=============================================================
-
-### Enhancements
-
-* Add prebuilt binary for Xcode 11.6 to the release package.
-
-### Fixed
-
-* Creating an object inside migration which changed that object type's primary
-  key would hit an assertion failure mentioning primary_key_col
-  ([#6613](https://github.com/realm/realm-cocoa/issues/6613), since 5.0.0).
-* Modifying the value of a string primary key property inside a migration with
-  a Realm file which was upgraded from pre-5.0 would corrupt the property's
-  index, typically resulting in crashes. ([Core #3765](https://github.com/realm/realm-core/issues/3765), since 5.0.0).
-* Some Realm files which hit assertion failures when upgrading from the pre-5.0
-  file format should now upgrade correctly (Since 5.0.0).
-
-### Compatibility
-
-* File format: Generates Realms with format v10 (Reads and upgrades all previous formats)
-* Realm Object Server: 3.21.0 or later.
-* Realm Studio: 3.11 or later.
-* APIs are backwards compatible with all previous releases in the 5.x.y series.
-* Carthage release for Swift is built with Xcode 11.6.
-
-### Internal
-
-* Upgraded realm-core from v6.0.9 to v6.0.11
-* Upgraded realm-sync from v5.0.8 to v5.0.11
-
-5.3.0 Release notes (2020-07-14)
-=============================================================
-
-### Enhancements
-
-* Add `Realm.objectWillChange`, which is a Combine publisher that will emit a
-  notification each time the Realm is refreshed or a write transaction is
-  commited.
-
-### Fixed
-
-* Fix the spelling of `ObjectKeyIdentifiable`. The old spelling is available
-  and deprecated for compatiblity.
-* Rename `RealmCollection.publisher` to `RealmCollection.collectionPublisher`.
-  The old name interacted with the `publisher` defined by `Sequence` in very
-  confusing ways, so we need to use a different name. The `publisher` name is
-  still available for compatiblity. ([#6516](https://github.com/realm/realm-cocoa/issues/6516))
-* Work around "xcodebuild timed out while trying to read
-  SwiftPackageManagerExample.xcodeproj" errors when installing Realm via
-  Carthage. ([#6549](https://github.com/realm/realm-cocoa/issues/6549)).
-* Fix a performance regression when using change notifications. (Since 5.0.0,
-  [#6629](https://github.com/realm/realm-cocoa/issues/6629)).
-
-### Compatibility
-
-* File format: Generates Realms with format v10 (Reads and upgrades all previous formats)
-* Realm Object Server: 3.21.0 or later.
-* Realm Studio: 3.11 or later.
-* APIs are backwards compatible with all previous releases in the 5.x.y series.
-* Carthage release for Swift is built with Xcode 11.5.
-
-### Internal
-
-* Upgraded realm-core from v6.0.8 to v6.0.9
-* Upgraded realm-sync from v5.0.7 to v5.0.8
-
-5.2.0 Release notes (2020-06-30)
-=============================================================
-
-Xcode 11.3 and iOS 9 are now the minimum supported versions.
-
-### Enhancements
-
-* Add support for building with Xcode 12 beta 1. watchOS currently requires
-  removing x86_64 from the supported architectures. Support for the new 64-bit
-  watch simulator will come in a future release.
-
-### Fixed
-
-* Opening a Realm file in file format v6 (created by Realm Cocoa versions
-  between 2.4 and 2.10) would crash. (Since 5.0.0, [Core #3764](https://github.com/realm/realm-core/issues/3764)).
-* Upgrading v9 (pre-5.0) Realm files would create a redundant search index for
-  primary key properties. This index would then be removed the next time the
-  Realm was opened, resulting in some extra i/o in the upgrade process.
-  (Since 5.0.0, [Core #3787](https://github.com/realm/realm-core/issues/3787)).
-* Fixed a performance issue with upgrading v9 files with search indexes on
-  non-primary-key properties. (Since 5.0.0, [Core #3767](https://github.com/realm/realm-core/issues/3767)).
-* `List.index(of:)` would give incorrect results if it was the very first thing
-  called on that List after a Realm was refreshed following a write which
-  modified the List. (Since 5.0.0, [#6606](https://github.com/realm/realm-cocoa/issues/6606)).
-* If a ThreadSafeReference was the only remaining reference to a Realm,
-  multiple copies of the file could end up mapped into memory at once. This
-  probably did not have any symptoms other than increased memory usage. (Since 5.0.0).
-
-### Compatibility
-
-* File format: Generates Realms with format v10 (Reads and upgrades all previous formats)
-* Realm Object Server: 3.21.0 or later.
-* Realm Studio: 3.11 or later.
-* APIs are backwards compatible with all previous releases in the 5.x.y series.
-* Carthage release for Swift is built with Xcode 11.5.
-
-### Internal
-
-* Upgraded realm-core from v6.0.6 to v6.0.8
-* Upgraded realm-sync from v5.0.5 to v5.0.7
-
-5.1.0 Release notes (2020-06-22)
-=============================================================
-
-### Enhancements
-
-* Allow opening full-sync Realms in read-only mode. This disables local schema
-  initialization, which makes it possible to open a Realm which the user does
-  not have write access to without using asyncOpen. In addition, it will report
-  errors immediately when an operation would require writing to the Realm
-  rather than reporting it via the sync error handler only after the server
-  rejects the write.
-
-### Fixed
-
-* Opening a Realm using a configuration object read from an existing Realm
-  would incorrectly bind the new Realm to the original Realm's thread/queue,
-  resulting in "Realm accessed from incorrect thread." exceptions.
-  ([#6574](https://github.com/realm/realm-cocoa/issues/6574),
-  [#6559](https://github.com/realm/realm-cocoa/issues/6559), since 5.0.0).
-
-### Compatibility
-
-* File format: Generates Realms with format v10 (Reads and upgrades all previous formats)
-* Realm Object Server: 3.21.0 or later.
-* Realm Studio: 3.11 or later.
-* APIs are backwards compatible with all previous releases in the 5.x.y series.
-* Carthage release for Swift is built with Xcode 11.5.
-
 5.0.3 Release notes (2020-06-10)
 =============================================================
 

+ 2 - 13
Carthage/Checkouts/realm-cocoa/Configuration/Base.xcconfig

@@ -24,7 +24,6 @@ CLANG_WARN_STRICT_PROTOTYPES = YES;
 CLANG_WARN_SUSPICIOUS_MOVE = YES;
 CLANG_WARN_UNREACHABLE_CODE = YES;
 CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
-CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
 COMBINE_HIDPI_IMAGES = YES;
 ENABLE_STRICT_OBJC_MSGSEND = YES;
 GCC_C_LANGUAGE_STANDARD = gnu99;
@@ -58,20 +57,10 @@ CODE_SIGN_IDENTITY[sdk=iphone*] = iPhone Developer;
 CODE_SIGNING_REQUIRED[sdk=macosx] = NO;
 
 MACOSX_DEPLOYMENT_TARGET = 10.9;
-IPHONEOS_DEPLOYMENT_TARGET = 9.0;
+IPHONEOS_DEPLOYMENT_TARGET = 8.0;
 WATCHOS_DEPLOYMENT_TARGET = 2.0;
 TVOS_DEPLOYMENT_TARGET = 9.0;
 
-// Xcode 11 "helpfully" "corrects" arm64 to x86_64 when you try to exclude
-// arm64 on platforms that it doesn't support building for arm64 on.
-REALM_ARM_ARCHS_1200 = arm64 arm64e;
-REALM_ARM_ARCHS = $(REALM_ARM_ARCHS_$(XCODE_VERSION_MAJOR))
-
-EXCLUDED_ARCHS[sdk=macosx*] = $(REALM_ARM_ARCHS);
-EXCLUDED_ARCHS[sdk=watchsimulator*] = $(REALM_ARM_ARCHS);
-EXCLUDED_ARCHS[sdk=iphonesimulator*] = $(REALM_ARM_ARCHS);
-EXCLUDED_ARCHS[sdk=appletvsimulator*] = $(REALM_ARM_ARCHS);
-
-SWIFT_VERSION = 5.0;
+SWIFT_VERSION = 4.0;
 TARGETED_DEVICE_FAMILY = 1,2,3,4;
 SDKROOT = $(REALM_SDKROOT);

+ 1 - 1
Carthage/Checkouts/realm-cocoa/Configuration/Realm/Realm iOS static.xcconfig

@@ -2,7 +2,7 @@
 
 SUPPORTED_PLATFORMS = iphoneos iphonesimulator;
 TARGETED_DEVICE_FAMILY = 1,2;
-IPHONEOS_DEPLOYMENT_TARGET = 9.0;
+IPHONEOS_DEPLOYMENT_TARGET = 8.0;
 
 MACH_O_TYPE = staticlib;
 EXECUTABLE_NAME = Realm;

+ 1 - 1
Carthage/Checkouts/realm-cocoa/Configuration/Realm/Tests iOS static.xcconfig

@@ -2,6 +2,6 @@
 
 CONFIGURATION_BUILD_DIR = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)-static;
 CONFIGURATION_TEMP_DIR = $(PROJECT_TEMP_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)-static;
-IPHONEOS_DEPLOYMENT_TARGET = 9.0;
+IPHONEOS_DEPLOYMENT_TARGET = 8.0;
 
 TEST_HOST[sdk=iphone*] = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)-static/TestHost static.app/TestHost static;

+ 1 - 1
Carthage/Checkouts/realm-cocoa/Configuration/TestHost.xcconfig

@@ -22,4 +22,4 @@ PRINCIPAL_CLASS[sdk=iphone*] = UIApplication;
 PRINCIPAL_CLASS[sdk=appletv*] = UIApplication;
 PRINCIPAL_CLASS[sdk=macosx*] = NSApplication;
 
-IPHONEOS_DEPLOYMENT_TARGET = 9.0;
+IPHONEOS_DEPLOYMENT_TARGET = 8.0;

+ 7 - 2
Carthage/Checkouts/realm-cocoa/Jenkinsfile.releasability

@@ -1,9 +1,9 @@
-xcodeVersions = ['11.3', '11.4.1', '11.5', '11.6']
+xcodeVersions = ['10.3', '11.1', '11.2.1', '11.3', '11.4.1', '11.5']
 platforms = ['osx', 'ios', 'watchos', 'tvos', 'catalyst']
 carthagePlatforms = ['osx', 'ios', 'watchos', 'tvos']
 platformNames = ['osx': 'macOS', 'ios': 'iOS', 'watchos': 'watchOS', 'tvos': 'tvOS', 'catalyst': 'Catalyst']
 carthageXcodeVersion = '11.5'
-objcXcodeVersion = '11.3'
+objcXcodeVersion = '10.3'
 docsSwiftVersion = '5.2.4'
 
 def installationTest(platform, test, language) {
@@ -163,6 +163,11 @@ def doBuild() {
             unstash "${platform}-${objcXcodeVersion}"
           }
 
+          // The 10.x builds don't actually have a framework for catalyst, so
+          // use the 11.0 version instead
+          unstash 'catalyst-11.1'
+          sh "mv realm-framework-catalyst-11.1.zip realm-framework-catalyst-${objcXcodeVersion}.zip"
+
           unstash 'ios-static'
           unstash 'examples'
           unstash 'source'

+ 1 - 1
Carthage/Checkouts/realm-cocoa/Realm.podspec

@@ -95,7 +95,7 @@ Pod::Spec.new do |s|
                               }
   s.preserve_paths          = %w(build.sh include)
 
-  s.ios.deployment_target   = '9.0'
+  s.ios.deployment_target   = '8.0'
   s.ios.vendored_library    = 'core/librealmcore-ios.a'
 
   s.osx.deployment_target   = '10.9'

+ 0 - 97
Carthage/Checkouts/realm-cocoa/Realm/ObjectServerTests/RLMObjectServerTests.mm

@@ -21,15 +21,12 @@
 #import "RLMSyncSessionRefreshHandle+ObjectServerTests.h"
 #import "RLMSyncUser+ObjectServerTests.h"
 
-#import "RLMObjectSchema_Private.hpp"
 #import "RLMRealm+Sync.h"
 #import "RLMRealmConfiguration_Private.h"
 #import "RLMRealmUtil.hpp"
 #import "RLMRealm_Dynamic.h"
 #import "RLMRealm_Private.hpp"
-#import "RLMSchema_Private.h"
 #import "RLMSyncUtil_Private.h"
-
 #import "shared_realm.hpp"
 
 #pragma mark - Test objects
@@ -2354,98 +2351,4 @@ static NSURL *certificateURL(NSString *filename) {
     [self waitForExpectations:@[ex3, ex4] timeout:4.0];
 }
 
-#pragma mark - Read Only
-
-- (RLMSyncUser *)userForTest:(SEL)sel {
-    return [self logInUserForCredentials:[RLMObjectServerTests basicCredentialsWithName:NSStringFromSelector(sel)
-                                                                               register:self.isParent]
-                                  server:[RLMObjectServerTests authServerURL]];
-}
-
-- (void)testPartialSyncCannotBeReadOnly {
-    RLMSyncUser *user = [self userForTest:_cmd];
-    RLMRealmConfiguration *config = [user configurationWithURL:nil fullSynchronization:NO];
-    RLMAssertThrowsWithReason(config.readOnly = true,
-                              @"Read-only mode is not supported for query-based sync.");
-}
-
-- (void)testOpenSynchronouslyInReadOnlyBeforeRemoteSchemaIsInitialized {
-    NSURL *url = REALM_URL();
-    RLMSyncUser *user = [self userForTest:_cmd];
-
-    if (self.isParent) {
-        RLMRealmConfiguration *config = [user configurationWithURL:url fullSynchronization:YES];
-        config.readOnly = true;
-        RLMRealm *realm = [RLMRealm realmWithConfiguration:config error:nil];
-        CHECK_COUNT(0, SyncObject, realm);
-        RLMRunChildAndWait();
-        [self waitForDownloadsForUser:user realms:@[realm] realmURLs:@[url] expectedCounts:@[@3]];
-    } else {
-        RLMRealm *realm = [self openRealmForURL:url user:user];
-        [self addSyncObjectsToRealm:realm descriptions:@[@"child-1", @"child-2", @"child-3"]];
-        [self waitForUploadsForRealm:realm];
-        CHECK_COUNT(3, SyncObject, realm);
-    }
-}
-
-- (void)testAddPropertyToReadOnlyRealmWithExistingLocalCopy {
-    NSURL *url = REALM_URL();
-    RLMSyncUser *user = [self userForTest:_cmd];
-
-    if (!self.isParent) {
-        RLMRealm *realm = [self openRealmForURL:url user:user];
-        [self addSyncObjectsToRealm:realm descriptions:@[@"child-1", @"child-2", @"child-3"]];
-        [self waitForUploadsForRealm:realm];
-        return;
-    }
-    RLMRunChildAndWait();
-
-    RLMRealmConfiguration *config = [user configurationWithURL:url fullSynchronization:YES];
-    config.readOnly = true;
-    @autoreleasepool {
-        (void)[self asyncOpenRealmWithConfiguration:config];
-    }
-
-    RLMObjectSchema *objectSchema = [RLMObjectSchema schemaForObjectClass:SyncObject.class];
-    objectSchema.properties = [RLMObjectSchema schemaForObjectClass:HugeSyncObject.class].properties;
-    config.customSchema = [[RLMSchema alloc] init];
-    config.customSchema.objectSchema = @[objectSchema];
-
-    RLMAssertThrowsWithReason([RLMRealm realmWithConfiguration:config error:nil],
-                              @"Property 'SyncObject.dataProp' has been added.");
-
-    @autoreleasepool {
-        NSError *error = [self asyncOpenErrorWithConfiguration:config];
-        XCTAssertNotEqual([error.localizedDescription rangeOfString:@"Property 'SyncObject.dataProp' has been added."].location,
-                          NSNotFound);
-    }
-}
-
-- (void)testAddPropertyToReadOnlyRealmWithAsyncOpen {
-    NSURL *url = REALM_URL();
-    RLMSyncUser *user = [self userForTest:_cmd];
-
-    if (!self.isParent) {
-        RLMRealm *realm = [self openRealmForURL:url user:user];
-        [self addSyncObjectsToRealm:realm descriptions:@[@"child-1", @"child-2", @"child-3"]];
-        [self waitForUploadsForRealm:realm];
-        return;
-    }
-    RLMRunChildAndWait();
-
-    RLMRealmConfiguration *config = [user configurationWithURL:url fullSynchronization:YES];
-    config.readOnly = true;
-
-    RLMObjectSchema *objectSchema = [RLMObjectSchema schemaForObjectClass:SyncObject.class];
-    objectSchema.properties = [RLMObjectSchema schemaForObjectClass:HugeSyncObject.class].properties;
-    config.customSchema = [[RLMSchema alloc] init];
-    config.customSchema.objectSchema = @[objectSchema];
-
-    @autoreleasepool {
-        NSError *error = [self asyncOpenErrorWithConfiguration:config];
-        XCTAssertNotEqual([error.localizedDescription rangeOfString:@"Property 'SyncObject.dataProp' has been added."].location,
-                          NSNotFound);
-    }
-}
-
 @end

+ 0 - 30
Carthage/Checkouts/realm-cocoa/Realm/ObjectServerTests/RLMPermissionsAPITests.m

@@ -555,36 +555,6 @@ static NSURL *makeTildeSubstitutedURL(NSURL *url, RLMSyncUser *user) {
     REVOKE_PERMISSION(p, admin);
 }
 
-- (void)testReadAccessWithClassSuperset {
-    NSString *testName = NSStringFromSelector(_cmd);
-
-    // Create a Realm with only a single object type
-    NSURL *userAURL = makeTestURL(testName, nil);
-    RLMRealmConfiguration *userAConfig = [self.userA configurationWithURL:userAURL fullSynchronization:YES];
-    userAConfig.objectClasses = @[SyncObject.self];
-    RLMRealm *userARealm = [self asyncOpenRealmWithConfiguration:userAConfig];
-    [self addSyncObjectsToRealm:userARealm descriptions:@[@"child-1", @"child-2", @"child-3"]];
-    [self waitForUploadsForRealm:userARealm];
-    CHECK_COUNT(3, SyncObject, userARealm);
-
-    // Give user B read-only permissions to that Realm so that it can't add new object types
-    RLMSyncPermission *p = [[RLMSyncPermission alloc] initWithRealmPath:[userAURL path]
-                                                               identity:self.userB.identity
-                                                            accessLevel:RLMSyncAccessLevelRead];
-    APPLY_PERMISSION(p, self.userA);
-
-    // Open the same Realm s user B without limiting the set of object classes
-    NSURL *userBURL = makeTestURL(testName, self.userA);
-    RLMRealmConfiguration *userBConfig = [self.userB configurationWithURL:userBURL fullSynchronization:YES];
-    userBConfig.readOnly = YES;
-    RLMRealm *userBRealm = [self asyncOpenRealmWithConfiguration:userBConfig];
-    CHECK_COUNT(3, SyncObject, userBRealm);
-
-    // Verify that syncing is actually working and new objects written by A show up in B's Realm
-    [self addSyncObjectsToRealm:userARealm descriptions:@[@"child-4"]];
-    CHECK_COUNT_PENDING_DOWNLOAD(4, SyncObject, userBRealm);
-}
-
 #pragma mark - Permission change API
 
 /// Setting a permission should work, and then that permission should be able to be retrieved.

+ 0 - 6
Carthage/Checkouts/realm-cocoa/Realm/ObjectServerTests/RLMSyncTestCase.h

@@ -58,12 +58,6 @@ NS_ASSUME_NONNULL_BEGIN
 /// Synchronously open a synced Realm and wait until the binding process has completed or failed.
 - (RLMRealm *)openRealmWithConfiguration:(RLMRealmConfiguration *)configuration;
 
-/// Synchronously open a synced Realm via asyncOpen and return the Realm.
-- (RLMRealm *)asyncOpenRealmWithConfiguration:(RLMRealmConfiguration *)configuration;
-
-/// Synchronously open a synced Realm via asyncOpen and return the expected error.
-- (NSError *)asyncOpenErrorWithConfiguration:(RLMRealmConfiguration *)configuration;
-
 /// Synchronously open a synced Realm. Also run a block right after the Realm is created.
 - (RLMRealm *)openRealmForURL:(NSURL *)url
                          user:(RLMSyncUser *)user

+ 1 - 45
Carthage/Checkouts/realm-cocoa/Realm/ObjectServerTests/RLMSyncTestCase.mm

@@ -349,37 +349,6 @@ static NSURL *syncDirectoryForChildProcess() {
               @"Timed out while trying to asynchronously open Realm for URL: %@", syncConfig.realmURL);
     return realm;
 }
-
-- (RLMRealm *)asyncOpenRealmWithConfiguration:(RLMRealmConfiguration *)config {
-    __block RLMRealm *realm = nil;
-    XCTestExpectation *ex = [self expectationWithDescription:@"Should asynchronously open a Realm"];
-    [RLMRealm asyncOpenWithConfiguration:config
-                           callbackQueue:dispatch_get_main_queue()
-                                callback:^(RLMRealm *r, NSError *err){
-        XCTAssertNil(err);
-        XCTAssertNotNil(r);
-        realm = r;
-        [ex fulfill];
-    }];
-    [self waitForExpectationsWithTimeout:10.0 handler:nil];
-    return realm;
-}
-
-- (NSError *)asyncOpenErrorWithConfiguration:(RLMRealmConfiguration *)config {
-    __block NSError *error = nil;
-    XCTestExpectation *ex = [self expectationWithDescription:@"Should fail to asynchronously open a Realm"];
-    [RLMRealm asyncOpenWithConfiguration:config
-                           callbackQueue:dispatch_get_main_queue()
-                                callback:^(RLMRealm *r, NSError *err){
-        XCTAssertNotNil(err);
-        XCTAssertNil(r);
-        error = err;
-        [ex fulfill];
-    }];
-    [self waitForExpectationsWithTimeout:10.0 handler:nil];
-    return error;
-}
-
 - (RLMRealm *)immediatelyOpenRealmForURL:(NSURL *)url user:(RLMSyncUser *)user {
     return [self immediatelyOpenRealmForURL:url
                                        user:user
@@ -573,20 +542,7 @@ static NSURL *syncDirectoryForChildProcess() {
 }
 
 - (void)resetSyncManager {
-    NSMutableArray *expectations = [NSMutableArray new];
-    for (RLMSyncUser *user in RLMSyncManager.sharedManager._allUsers) {
-        [user logOut];
-        // Sessions are removed from the user asynchronously after a logout.
-        // We need to wait for this to happen before calling resetForTesting as
-        // that expects all sessions to be cleaned up first. This doesn't apply
-        // to admin token users, which don't logout at all (and don't have an
-        // auth server).
-        if (user.authenticationServer && user.allSessions.count) {
-            [expectations addObject:[self expectationForPredicate:[NSPredicate predicateWithFormat:@"allSessions.@count == 0"]
-                                              evaluatedWithObject:user handler:nil]];
-        }
-    }
-    [self waitForExpectations:expectations timeout:5.0];
+    [RLMSyncManager.sharedManager._allUsers makeObjectsPerformSelector:@selector(logOut)];
     [RLMSyncManager resetForTesting];
     [RLMSyncSessionRefreshHandle calculateFireDateUsingTestLogic:NO blockOnRefreshCompletion:nil];
 }

+ 3 - 2
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/CMake/CodeCoverage.cmake

@@ -20,7 +20,8 @@ find_program(LCOV_PATH lcov)
 find_program(GENHTML_PATH genhtml)
 find_program(GCOVR_PATH gcovr PATHS ${CMAKE_SOURCE_DIR}/tests)
 
-set(CMAKE_CXX_FLAGS_COVERAGE "-g -O0 -fprofile-arcs -ftest-coverage -DCATCH_CONFIG_FAST_COMPILE")
+set(CMAKE_CXX_FLAGS_COVERAGE "-g -O0 -fprofile-arcs -ftest-coverage -DCATCH_CONFIG_FAST_COMPILE"
+    CACHE STRING "Flags used by the C++ compiler during coverage builds.")
 mark_as_advanced(CMAKE_CXX_FLAGS_COVERAGE)
 
 if(CMAKE_BUILD_TYPE STREQUAL "Coverage")
@@ -49,7 +50,7 @@ if(CMAKE_BUILD_TYPE STREQUAL "Coverage")
 
     add_custom_target(${targetname}-cobertura
       COMMAND ${testrunner}
-      COMMAND ${GCOVR_PATH} -x -o coverage.xml -f 'src/.*' -f "${CMAKE_SOURCE_DIR}/src.*" --exclude-directories "${CMAKE_BINARY_DIR}/tests" --exclude-directories="${CMAKE_SOURCE_DIR}/\.tmp" --exclude ".*realm\-core.*" --exclude ".*realm\-sync.*"
+      COMMAND ${GCOVR_PATH} -x -r ${CMAKE_SOURCE_DIR}/src ./src -o coverage.xml
       COMMAND echo Code coverage report written to coverage.xml
 
       WORKING_DIRECTORY ${CMAKE_BINARY_DIR}

+ 3 - 3
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/CMake/RealmCore.cmake

@@ -200,7 +200,7 @@ function(download_realm_core core_version)
     set_property(TARGET realm PROPERTY IMPORTED_LOCATION_RELEASE ${core_library_release})
     set_property(TARGET realm PROPERTY IMPORTED_LOCATION ${core_library_release})
 
-    set_property(TARGET realm PROPERTY INTERFACE_LINK_LIBRARIES ${CRYPTO_LIBRARIES} Threads::Threads)
+    set_property(TARGET realm PROPERTY INTERFACE_LINK_LIBRARIES Threads::Threads ${CRYPTO_LIBRARIES})
 
     # Create directories that are included in INTERFACE_INCLUDE_DIRECTORIES, as CMake requires they exist at
     # configure time, when they'd otherwise not be created until we download and extract core.
@@ -223,8 +223,8 @@ macro(build_realm_core)
         BUILD_IN_SOURCE 1
         UPDATE_DISCONNECTED 1
         INSTALL_COMMAND ""
-        CONFIGURE_COMMAND cmake -B build.debug -DOpenSSL_DIR=${CMAKE_BINARY_DIR}/openssl/lib/cmake/OpenSSL -D CMAKE_BUILD_TYPE=Debug ${CORE_SANITIZER_FLAGS} -G Ninja
-                       && cmake -B build.release -DOpenSSL_DIR=${CMAKE_BINARY_DIR}/openssl/lib/cmake/OpenSSL -D CMAKE_BUILD_TYPE=RelWithDebInfo ${CORE_SANITIZER_FLAGS} -G Ninja
+        CONFIGURE_COMMAND cmake -B build.debug -DOpenSSL_DIR="${CMAKE_BINARY_DIR}/openssl/lib/cmake/OpenSSL" -D CMAKE_BUILD_TYPE=Debug ${CORE_SANITIZER_FLAGS} -G Ninja
+                       && cmake -B build.release -DOpenSSL_DIR="${CMAKE_BINARY_DIR}/openssl/lib/cmake/OpenSSL" -D CMAKE_BUILD_TYPE=RelWithDebInfo ${CORE_SANITIZER_FLAGS} -G Ninja
                        
         BUILD_COMMAND cmake --build build.debug --target Storage --target QueryParser
                    && cmake --build build.release --target Storage --target QueryParser

+ 17 - 17
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/Jenkinsfile

@@ -1,7 +1,4 @@
 #!groovy
-
-@Library('realm-ci') _
-
 def getSourceArchive() {
   deleteDir()
   unstash 'source'
@@ -26,11 +23,10 @@ def buildDockerEnv(name, dockerfile='Dockerfile', extra_args='') {
   return docker.image(name)
 }
 
-def publishCoverageReport(String label) {
+def publishReport(String label) {
   // Unfortunately, we cannot add a title or tag to individual coverage reports.
   echo "Unstashing coverage-${label}"
   unstash("coverage-${label}")
-
   step([
     $class: 'CoberturaPublisher',
     autoUpdateHealth: false,
@@ -50,7 +46,7 @@ if (env.BRANCH_NAME == 'master') {
   env.DOCKER_PUSH = "1"
 }
 
-def doDockerBuild(String flavor, Boolean enableSync, String sanitizerFlags = "") {
+def doDockerBuild(String flavor, Boolean withCoverage, Boolean enableSync, String sanitizerFlags = "") {
   def sync = enableSync ? "sync" : ""
   def label = "${flavor}${enableSync ? '-sync' : ''}"
 
@@ -60,9 +56,17 @@ def doDockerBuild(String flavor, Boolean enableSync, String sanitizerFlags = "")
       def image = buildDockerEnv("ci/realm-object-store:${flavor}")
       sshagent(['realm-ci-ssh']) {
         image.inside("-v /etc/passwd:/etc/passwd:ro -v ${env.HOME}:${env.HOME} -v ${env.SSH_AUTH_SOCK}:${env.SSH_AUTH_SOCK} -e HOME=${env.HOME}") {
-          sh "./workflow/build.sh ${flavor} ${sync} ${sanitizerFlags}"
+          if(withCoverage) {
+            sh "rm -rf coverage.build ${label}.build && ./workflow/test_coverage.sh ${sync} && mv coverage.build ${label}.build"
+          } else {
+            sh "./workflow/build.sh ${flavor} ${sync} ${sanitizerFlags}"
+          }
         }
       }
+      if(withCoverage) {
+        echo "Stashing coverage-${label}"
+        stash includes: "${label}.build/coverage.xml", name: "coverage-${label}"
+      }
     }
   }
 }
@@ -162,10 +166,10 @@ stage('prepare') {
 
 stage('unit-tests') {
   parallel(
-    linux: doDockerBuild('linux', false),
-    linux_sync: doDockerBuild('linux', true),
-    linux_asan: doDockerBuild('linux', true, '-DSANITIZE_ADDRESS=1'),
-    linux_tsan: doDockerBuild('linux', true, '-DSANITIZE_THREAD=1'),
+    linux: doDockerBuild('linux', false, false),
+    linux_sync: doDockerBuild('linux', true, true),
+    linux_asan: doDockerBuild('linux', false, true, '-DSANITIZE_ADDRESS=1'),
+    linux_tsan: doDockerBuild('linux', false, true, '-DSANITIZE_THREAD=1'),
     android: doAndroidDockerBuild(),
     macos: doBuild('osx', 'macOS', false, ''),
     macos_sync: doBuild('osx', 'macOS', true, ''),
@@ -177,11 +181,7 @@ stage('unit-tests') {
 
 stage('publish') {
   node('docker') {
-    // we need sources to allow the coverage report to display them
-    rlmCheckout(scm)
-    // coverage reports assume sources are in the parent directory
-    dir("build") {
-      publishCoverageReport('macOS-sync')
-    }
+    publishReport('linux-sync')
+    publishReport('macOS-sync')
   }
 }

+ 2 - 2
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/dependencies.list

@@ -1,4 +1,4 @@
-REALM_CORE_VERSION=6.0.10
-REALM_SYNC_VERSION=5.0.9
+REALM_CORE_VERSION=6.0.1
+REALM_SYNC_VERSION=5.0.0
 REALM_CORE_PACKAGING=2
 OPENSSL_VERSION=1.1.1b

+ 2 - 10
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/src/impl/results_notifier.cpp

@@ -181,21 +181,13 @@ void ResultsNotifier::do_prepare_handover(Transaction& sg)
 bool ResultsNotifier::prepare_to_deliver()
 {
     auto lock = lock_target();
-    auto realm = get_realm();
-    if (!realm) {
+    if (!get_realm()) {
         m_handover_tv.reset();
         m_delivered_tv.reset();
         return false;
     }
-    if (!m_handover_tv) {
-        bool transaction_is_stale = m_delivered_transaction &&
-            (!realm->is_in_read_transaction() || realm->read_transaction_version() > m_delivered_transaction->get_version_of_current_transaction());
-        if (transaction_is_stale) {
-            m_delivered_tv.reset();
-            m_delivered_transaction.reset();
-        }
+    if (!m_handover_tv)
         return true;
-    }
 
     m_results_were_used = !m_delivered_tv;
     m_delivered_tv.reset();

+ 0 - 17
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/src/object.cpp

@@ -124,23 +124,6 @@ Property const& Object::property_for_name(StringData prop_name) const
     return *prop;
 }
 
-void Object::validate_property_for_setter(Property const& property) const
-{
-    verify_attached();
-    m_realm->verify_in_write();
-
-    // Modifying primary keys is allowed in migrations to make it possible to
-    // add a new primary key to a type (or change the property type), but it
-    // is otherwise considered the immutable identity of the row
-    if (property.is_primary) {
-        if (!m_realm->is_in_migration())
-            throw ModifyPrimaryKeyException(m_object_schema->name, property.name);
-        // Modifying the PK property while it's the PK will corrupt the table,
-        // so remove it and then restore it at the end of the migration (which will rebuild the table)
-        m_obj.get_table()->set_primary_key_column({});
-    }
-}
-
 #if REALM_ENABLE_SYNC
 void Object::ensure_user_in_everyone_role()
 {

+ 0 - 1
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/src/object.hpp

@@ -146,7 +146,6 @@ private:
 
     void verify_attached() const;
     Property const& property_for_name(StringData prop_name) const;
-    void validate_property_for_setter(Property const&) const;
 };
 
 struct InvalidatedObjectException : public std::logic_error {

+ 47 - 58
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/src/object_accessor.hpp

@@ -43,8 +43,16 @@ template <typename ValueType, typename ContextType>
 void Object::set_property_value(ContextType& ctx, StringData prop_name,
                                 ValueType value, CreatePolicy policy)
 {
+    verify_attached();
+    m_realm->verify_in_write();
     auto& property = property_for_name(prop_name);
-    validate_property_for_setter(property);
+
+    // Modifying primary keys is allowed in migrations to make it possible to
+    // add a new primary key to a type (or change the property type), but it
+    // is otherwise considered the immutable identity of the row
+    if (property.is_primary && !m_realm->is_in_migration())
+        throw ModifyPrimaryKeyException(m_object_schema->name, property.name);
+
     set_property_value_impl(ctx, property, value, policy, false);
 }
 
@@ -177,16 +185,6 @@ Object Object::create(ContextType& ctx, std::shared_ptr<Realm> const& realm,
     return create(ctx, realm, *object_schema, value, policy, current_obj, out_row);
 }
 
-template<typename ValueType, typename ContextType>
-Mixed as_mixed(ContextType& ctx, ValueType& value, PropertyType type)
-{
-    if (!value)
-        return {};
-    return switch_on_type(type, [&](auto* t) {
-        return Mixed(ctx.template unbox<NonObjTypeT<decltype(*t)>>(*value));
-    });
-}
-
 template<typename ValueType, typename ContextType>
 Object Object::create(ContextType& ctx, std::shared_ptr<Realm> const& realm,
                       ObjectSchema const& object_schema, ValueType value,
@@ -194,75 +192,69 @@ Object Object::create(ContextType& ctx, std::shared_ptr<Realm> const& realm,
 {
     realm->verify_in_write();
 
-    // When setting each property, we normally want to skip over the primary key
-    // as that's set as part of object creation. However, during migrations the
-    // property marked as the primary key in the schema may not currently be
-    // considered a primary key by core, and so will need to be set.
-    bool skip_primary = true;
-    // If the input value is missing values for any of the properties we want to
-    // set the propery to the default value for new objects, but leave it
-    // untouched for existing objects.
+    // get or create our accessor
     bool created = false;
 
+    // try to get existing row if updating
     Obj obj;
     auto table = realm->read_group().get_table(object_schema.table_key);
 
-    // If there's a primary key, we need to first check if an object with the
-    // same primary key already exists. If it does, we either update that object
-    // or throw an exception if updating is disabled.
+    bool skip_primary = true;
     if (auto primary_prop = object_schema.primary_key_property()) {
+        // search for existing object based on primary key type
         auto primary_value = ctx.value_for_property(value, *primary_prop,
                                                     primary_prop - &object_schema.persisted_properties[0]);
         if (!primary_value)
             primary_value = ctx.default_value_for_property(object_schema, *primary_prop);
-        if (!primary_value && !is_nullable(primary_prop->type))
-            throw MissingPropertyValueException(object_schema.name, primary_prop->name);
-
-        // When changing the primary key of a table, we remove the existing pk (if any), call
-        // the migration function, then add the new pk (if any). This means that we can't call
-        // create_object_with_primary_key(), and creating duplicate primary keys is allowed as
-        // long as they're unique by the end of the migration.
-        if (table->get_primary_key_column() == ColKey{}) {
-            REALM_ASSERT(realm->is_in_migration());
-            if (policy != CreatePolicy::ForceCreate) {
-                if (auto key = get_for_primary_key_impl(ctx, *table, *primary_prop, *primary_value))
-                    obj = table->get_object(key);
-            }
-            if (!obj)
+        if (!primary_value) {
+            if (!is_nullable(primary_prop->type))
+                throw MissingPropertyValueException(object_schema.name, primary_prop->name);
+            primary_value = ctx.null_value();
+        }
+        auto key = get_for_primary_key_impl(ctx, *table, *primary_prop, *primary_value);
+        if (key) {
+            if (policy != CreatePolicy::ForceCreate)
+                obj = table->get_object(key);
+            else if (realm->is_in_migration()) {
+                // Creating objects with duplicate primary keys is allowed in migrations
+                // as long as there are no duplicates at the end, as adding an entirely
+                // new column which is the PK will inherently result in duplicates at first
+                obj = table->create_object();
+                created = true;
                 skip_primary = false;
+            }
+            else {
+                throw std::logic_error(util::format("Attempting to create an object of type '%1' with an existing primary key value '%2'.",
+                                                    object_schema.name, ctx.print(*primary_value)));
+            }
         }
         else {
-            obj = table->create_object_with_primary_key(as_mixed(ctx, primary_value, primary_prop->type), &created);
-            if (!created && policy == CreatePolicy::ForceCreate) {
-                if (!realm->is_in_migration()) {
-                    throw std::logic_error(util::format("Attempting to create an object of type '%1' with an existing primary key value '%2'.",
-                                                        object_schema.name, ctx.print(*primary_value)));
-                }
-                table->set_primary_key_column(ColKey{});
-                skip_primary = false;
-                obj = {};
+            created = true;
+            Mixed primary_key;
+            if (primary_prop->type == PropertyType::Int) {
+                primary_key = ctx.template unbox<util::Optional<int64_t>>(*primary_value);
+            }
+            else if (primary_prop->type == PropertyType::String) {
+                primary_key = ctx.template unbox<StringData>(*primary_value);
             }
+            else {
+                REALM_TERMINATE("Unsupported primary key type.");
+            }
+            obj = table->create_object_with_primary_key(primary_key);
         }
     }
-
-    // No primary key (possibly temporarily due to migrations). If we're
-    // currently performing a recursive update on an existing object tree then
-    // an object key was passed in that we need to look up, and otherwise we
-    // need to create the new object.
-    if (!obj) {
+    else {
         if (policy == CreatePolicy::UpdateModified && current_obj) {
             obj = table->get_object(current_obj);
         }
         else {
-            obj = table->create_object();
+        obj = table->create_object();
             created = true;
         }
     }
 
+    // populate
     Object object(realm, object_schema, obj);
-    // KVO in Cocoa requires that the obj ivar on the wrapper object be set
-    // *before* we start setting the properties, so it passes in a pointer to
-    // that.
     if (out_row)
         *out_row = obj;
     for (size_t i = 0; i < object_schema.persisted_properties.size(); ++i) {
@@ -279,9 +271,6 @@ Object Object::create(ContextType& ctx, std::shared_ptr<Realm> const& realm,
             v = ctx.default_value_for_property(object_schema, prop);
             is_default = true;
         }
-        // We consider null or a missing value to be equivalent to an empty
-        // array for historical reasons; the original implementation did this
-        // accidentally and it's not worth changing.
         if ((!v || ctx.is_null(*v)) && !is_nullable(prop.type) && !is_array(prop.type)) {
             if (prop.is_primary || !ctx.allow_missing(value))
                 throw MissingPropertyValueException(object_schema.name, prop.name);

+ 0 - 13
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/src/property.hpp

@@ -173,19 +173,6 @@ inline constexpr bool is_nullable(PropertyType a)
     return to_underlying(a & PropertyType::Nullable) == to_underlying(PropertyType::Nullable);
 }
 
-// Some of the places we use switch_on_type() the Obj version isn't instantiatable
-// or reachable, so we want to map it to a valid type to let the unreachable code compile
-template<typename T>
-struct NonObjType {
-    using type = std::remove_reference_t<T>;
-};
-template<>
-struct NonObjType<Obj&> {
-    using type = int64_t;
-};
-template<typename T>
-using NonObjTypeT = typename NonObjType<T>::type;
-
 template<typename ObjType=Obj, typename Fn>
 static auto switch_on_type(PropertyType type, Fn&& fn)
 {

+ 15 - 5
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/src/thread_safe_reference.cpp

@@ -24,8 +24,6 @@
 #include "results.hpp"
 #include "shared_realm.hpp"
 
-#include "impl/realm_coordinator.hpp"
-
 #include <realm/db.hpp>
 #include <realm/keys.hpp>
 
@@ -35,7 +33,6 @@ public:
     virtual ~Payload() = default;
     Payload(Realm& realm)
     : m_transaction(realm.is_in_read_transaction() ? realm.duplicate() : nullptr)
-    , m_coordinator(Realm::Internal::get_coordinator(realm).shared_from_this())
     , m_created_in_write_transaction(realm.is_in_transaction())
     {
     }
@@ -46,7 +43,7 @@ protected:
     const TransactionRef m_transaction;
 
 private:
-    const std::shared_ptr<_impl::RealmCoordinator> m_coordinator;
+    const VersionID m_target_version;
     const bool m_created_in_write_transaction;
 };
 
@@ -109,6 +106,19 @@ private:
     std::string m_object_schema_name;
 };
 
+template<typename T>
+struct ListType {
+    using type = Lst<std::remove_reference_t<T>>;
+};
+
+// The code path which would instantiate List<Obj> isn't reachable, but still
+// produces errors about the type not being instantiable so we instead map it
+// to an arbitrary valid type
+template<>
+struct ListType<Obj&> {
+    using type = Lst<int64_t>;
+};
+
 template<>
 class ThreadSafeReference::PayloadImpl<Results> : public ThreadSafeReference::Payload {
 public:
@@ -148,7 +158,7 @@ public:
                 // match what happens for other types of handover where the
                 // object doesn't exist.
                 switch_on_type(ObjectSchema::from_core_type(*table, m_col_key), [&](auto* t) -> void {
-                    list = std::make_unique<Lst<NonObjTypeT<decltype(*t)>>>();
+                    list = std::make_unique<typename ListType<decltype(*t)>::type>();
                 });
             }
             return Results(r, std::move(list), m_ordering);

+ 0 - 3
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/src/thread_safe_reference.hpp

@@ -51,9 +51,6 @@ private:
     template<typename> class PayloadImpl;
     std::unique_ptr<Payload> m_payload;
 };
-
-template<> ThreadSafeReference::ThreadSafeReference(std::shared_ptr<Realm> const&);
-template<> std::shared_ptr<Realm> ThreadSafeReference::resolve(std::shared_ptr<Realm> const&);
 }
 
 #endif /* REALM_OS_THREAD_SAFE_REFERENCE_HPP */

+ 2 - 206
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/tests/migrations.cpp

@@ -716,14 +716,6 @@ TEST_CASE("migration: Automatic") {
             {"array target", {
                 {"value", PropertyType::Int},
             }},
-            {"int pk", {
-                {"pk", PropertyType::Int, Property::IsPrimary{true}},
-                {"value", PropertyType::Int},
-            }},
-            {"string pk", {
-                {"pk", PropertyType::String, Property::IsPrimary{true}},
-                {"value", PropertyType::Int},
-            }},
         };
 
         InMemoryTestFile config;
@@ -917,22 +909,10 @@ TEST_CASE("migration: Automatic") {
             });
         }
 
-        SECTION("upsert in new realm after modifying primary key") {
-            realm->update_schema(schema, 2, [&values](auto, auto new_realm, Schema&) {
-                get_table(new_realm, "all types")->set_primary_key_column(ColKey());
-                REQUIRE(new_realm->is_in_transaction());
-                CppContext ctx(new_realm);
-                any_cast<AnyDict&>(values)["bool"] = false;
-                Object obj = Object::create(ctx, new_realm, "all types", values, CreatePolicy::UpdateAll);
-                REQUIRE(get_table(new_realm, "all types")->size() == 1);
-                REQUIRE(get_table(new_realm, "link target")->size() == 2);
-                REQUIRE(get_table(new_realm, "array target")->size() == 2);
-                REQUIRE(any_cast<bool>(obj.get_property_value<util::Any>(ctx, "bool")) == false);
-            });
-        }
-
         SECTION("change primary key property type") {
             schema = set_type(schema, "all types", "pk", PropertyType::String);
+            // FIXME: changing the primary key of a type with binary columns currently crashes in core
+            schema = remove_property(schema, "all types", "data");
             realm->update_schema(schema, 2, [](auto, auto new_realm, auto&) {
                 Object obj(new_realm, "all types", 0);
 
@@ -963,169 +943,6 @@ TEST_CASE("migration: Automatic") {
             REQUIRE_NOTHROW(realm->update_schema(schema, 2, good_migration));
             REQUIRE(get_table(realm, "all types")->size() == 2);
         }
-
-        SECTION("modify existing int primary key values in migration") {
-            // Create several more objects to increase the chance of things
-            // actually breaking if we're doing invalid things
-            CppContext ctx(realm);
-            auto object_schema = realm->schema().find("all types");
-            realm->begin_transaction();
-            for (int i = 1; i < 10; ++i) {
-                any_cast<AnyDict&>(values)["pk"] = INT64_C(1) + i;
-                any_cast<AnyDict&>(values)["int"] = INT64_C(5) + i;
-                Object::create(ctx, realm, *object_schema, values);
-            }
-            realm->commit_transaction();
-
-            // Increase the PK of each object by one in a migration
-            realm->update_schema(schema, 2, [](auto, auto new_realm, Schema&) {
-                CppContext ctx(new_realm);
-                Results results(new_realm, get_table(new_realm, "all types"));
-                for (size_t i = 0, count = results.size(); i < count; ++i) {
-                    Object obj(new_realm, results.get<Obj>(i));
-                    util::Any v = 1 + any_cast<int64_t>(obj.get_property_value<util::Any>(ctx, "pk"));
-                    obj.set_property_value(ctx, "pk", v);
-                }
-            });
-
-            // Create a new object with the no-longer-used pk of 1
-            realm->begin_transaction();
-            any_cast<AnyDict&>(values)["pk"] = INT64_C(1);
-            any_cast<AnyDict&>(values)["int"] = INT64_C(4);
-            object_schema = realm->schema().find("all types");
-            Object::create(ctx, realm, *object_schema, values);
-            realm->commit_transaction();
-
-            // Verify results
-            auto table = get_table(realm, "all types");
-            REQUIRE(table->size() == 11);
-            REQUIRE(table->get_primary_key_column() == table->get_column_key("pk"));
-            for (int i = 0; i < 10; ++i) {
-                auto obj = table->get_object(i);
-                REQUIRE(obj.get<int64_t>("pk") == i + 2);
-                REQUIRE(obj.get<int64_t>("int") == i + 5);
-            }
-            auto obj = table->get_object(10);
-            REQUIRE(obj.get<int64_t>("pk") == 1);
-            REQUIRE(obj.get<int64_t>("int") == 4);
-        }
-
-        SECTION("modify existing string primary key values in migration") {
-            // Create several objects to increase the chance of things
-            // actually breaking if we're doing invalid things
-            CppContext ctx(realm);
-            auto object_schema = realm->schema().find("string pk");
-            realm->begin_transaction();
-            for (int64_t i = 0; i < 10; ++i) {
-                util::Any values = AnyDict{
-                    {"pk", util::to_string(i)},
-                    {"value", i + 1},
-                };
-                Object::create(ctx, realm, *object_schema, values);
-            }
-            realm->commit_transaction();
-
-            // Increase the PK of each object by one in a migration
-            realm->update_schema(schema, 2, [](auto, auto new_realm, Schema&) {
-                CppContext ctx(new_realm);
-                Results results(new_realm, get_table(new_realm, "string pk"));
-                for (size_t i = 0, count = results.size(); i < count; ++i) {
-                    Object obj(new_realm, results.get<Obj>(i));
-                    util::Any v = util::to_string(any_cast<int64_t>(obj.get_property_value<util::Any>(ctx, "value")));
-                    obj.set_property_value(ctx, "pk", v);
-                }
-            });
-
-            // Create a new object with the no-longer-used pk of 0
-            realm->begin_transaction();
-            util::Any values = AnyDict{
-                {"pk", "0"s},
-                {"value", INT64_C(0)},
-            };
-            object_schema = realm->schema().find("string pk");
-            Object::create(ctx, realm, *object_schema, values);
-            realm->commit_transaction();
-
-            // Verify results
-            auto table = get_table(realm, "string pk");
-            REQUIRE(table->size() == 11);
-            REQUIRE(table->get_primary_key_column() == table->get_column_key("pk"));
-            for (auto& obj : *table) {
-                REQUIRE(util::to_string(obj.get<int64_t>("value")).c_str() == obj.get<StringData>("pk"));
-            }
-        }
-
-        SECTION("create and modify int primary key inside migration") {
-            SECTION("with index") {
-                realm->begin_transaction();
-                auto table = get_table(realm, "int pk");
-                table->add_search_index(table->get_column_key("pk"));
-                realm->commit_transaction();
-            }
-            SECTION("no index") {
-            }
-
-            realm->update_schema(schema, 2, [](auto, auto new_realm, Schema&) {
-                CppContext ctx(new_realm);
-                for (int64_t i = 0; i < 10; ++i) {
-                    auto obj = Object::create(ctx, new_realm, *new_realm->schema().find("int pk"),
-                                              util::Any(AnyDict{
-                        {"pk", INT64_C(0)},
-                        {"value", i}
-                    }));
-                    obj.set_property_value(ctx, "pk", util::Any(i));
-                }
-            });
-
-            auto table = get_table(realm, "int pk");
-            REQUIRE(table->size() == 10);
-            REQUIRE(table->get_primary_key_column() == table->get_column_key("pk"));
-            for (int i = 0; i < 10; ++i) {
-                auto obj = table->get_object(i);
-                REQUIRE(obj.get<int64_t>("pk") == i);
-                REQUIRE(obj.get<int64_t>("value") == i);
-            }
-        }
-
-        SECTION("create and modify string primary key inside migration") {
-            SECTION("with index") {
-                realm->begin_transaction();
-                auto table = get_table(realm, "string pk");
-                table->add_search_index(table->get_column_key("pk"));
-                realm->commit_transaction();
-            }
-            SECTION("no index") {
-            }
-
-            realm->update_schema(schema, 2, [](auto, auto new_realm, Schema&) {
-                CppContext ctx(new_realm);
-                for (int64_t i = 0; i < 10; ++i) {
-                    auto obj = Object::create(ctx, new_realm, *new_realm->schema().find("string pk"),
-                                              util::Any(AnyDict{
-                        {"pk", ""s},
-                        {"value", i}
-                    }));
-                    obj.set_property_value(ctx, "pk", util::Any(util::to_string(i)));
-                }
-            });
-
-            auto table = get_table(realm, "string pk");
-            REQUIRE(table->size() == 10);
-            REQUIRE(table->get_primary_key_column() == table->get_column_key("pk"));
-            for (auto& obj : *table)
-                REQUIRE(obj.get<StringData>("pk") == util::to_string(obj.get<int64_t>("value")).c_str());
-        }
-
-        SECTION("create object after adding primary key") {
-            schema = set_primary_key(schema, "all types", "");
-            realm->update_schema(schema, 2);
-            schema = set_primary_key(schema, "all types", "pk");
-            REQUIRE_NOTHROW(realm->update_schema(schema, 3, [&](auto, auto new_realm, Schema&) {
-                CppContext ctx(new_realm);
-                any_cast<AnyDict&>(values)["pk"] = INT64_C(2);
-                Object::create(ctx, realm, "all types", values);
-            }));
-        }
     }
 
     SECTION("property renaming") {
@@ -1315,27 +1132,6 @@ TEST_CASE("migration: Automatic") {
             schema = set_indexed(schema, "object", "value", true);
             SUCCESSFUL_RENAME(schema, schema2, {"object", "value", "new"});
         }
-
-        SECTION("create object inside migration after renaming pk") {
-            schema = set_primary_key(schema, "object", "value");
-            auto new_schema = set_primary_key(rename_value(schema), "object", "new");
-            init(schema);
-            REQUIRE_NOTHROW(realm->update_schema(new_schema, 2, [](auto, auto realm, Schema& schema) {
-                ObjectStore::rename_property(realm->read_group(), schema,
-                                             "object", "value", "new");
-
-                CppContext ctx(realm);
-                util::Any values = AnyDict{{"new", INT64_C(11)}};
-                Object::create(ctx, realm, "object", values);
-            }));
-            REQUIRE(realm->schema() == new_schema);
-            VERIFY_SCHEMA(*realm, false);
-            auto table = ObjectStore::table_for_object_type(realm->read_group(), "object");
-            auto key = table->get_column_keys()[0];
-            auto it = table->begin();
-            REQUIRE(it->get<int64_t>(key) == 10);
-            REQUIRE((++it)->get<int64_t>(key) == 11);
-        }
     }
 }
 

+ 0 - 10
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/tests/results.cpp

@@ -980,7 +980,6 @@ TEST_CASE("notifications: TableView delivery") {
 
     InMemoryTestFile config;
     config.automatic_change_notifications = false;
-    config.max_number_of_active_versions = 5;
 
     auto r = Realm::get_shared_realm(config);
     r->update_schema({
@@ -1093,15 +1092,6 @@ TEST_CASE("notifications: TableView delivery") {
         REQUIRE(results.size() == 11);
         r->cancel_transaction();
     }
-
-    SECTION("unused background TVs do not pin old versions forever") {
-        // This will exceed the maximum active version count (5) if any
-        // transactions are being pinned, resulting in make_remote_change() throwing
-        for (int i = 0; i < 10; ++i) {
-            REQUIRE_NOTHROW(make_remote_change());
-            advance_and_notify(*r);
-        }
-    }
 }
 
 

+ 0 - 10
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/tests/thread_safe_reference.cpp

@@ -31,7 +31,6 @@
 #include "util/scheduler.hpp"
 
 #include "impl/object_accessor_impl.hpp"
-#include "impl/realm_coordinator.hpp"
 
 #include <realm/db.hpp>
 #include <realm/history.hpp>
@@ -859,19 +858,10 @@ TEST_CASE("thread safe reference") {
     SECTION("lifetime") {
         SECTION("retains source realm") { // else version will become unpinned
             auto ref = ThreadSafeReference(foo);
-            foo = {};
             r = nullptr;
             r = Realm::get_shared_realm(config);
             REQUIRE_NOTHROW(ref.resolve<Object>(r));
         }
-
-        SECTION("retains source RealmCoordinator") {
-            auto ref = ThreadSafeReference(foo);
-            auto coordinator = _impl::RealmCoordinator::get_existing_coordinator(config.path).get();
-            foo = {};
-            r = nullptr;
-            REQUIRE(coordinator == _impl::RealmCoordinator::get_existing_coordinator(config.path).get());
-        }
     }
 
     SECTION("metadata") {

+ 1 - 1
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/tests/util/test_file.hpp

@@ -142,7 +142,7 @@ struct SyncTestFile : TestFile {
 };
 
 struct TestSyncManager {
-    TestSyncManager(std::string const& base_path="", realm::SyncManager::MetadataMode = realm::SyncManager::MetadataMode::NoMetadata);
+    TestSyncManager(std::string const& base_path="", realm::SyncManager::MetadataMode = realm::SyncManager::MetadataMode::NoEncryption);
     ~TestSyncManager();
     static void configure(std::string const& base_path, realm::SyncManager::MetadataMode);
 };

+ 7 - 2
Carthage/Checkouts/realm-cocoa/Realm/ObjectStore/workflow/test_coverage.sh

@@ -6,6 +6,11 @@
 sync=${1}
 deps_suffix="${2}"
 
+nprocs=1
+if [ "$(uname)" = "Linux" ]; then
+  nprocs=$(grep -c ^processor /proc/cpuinfo)
+fi
+
 : ${OPENSSL_ROOT_DIR:=/usr/local}
 
 set -e
@@ -25,7 +30,7 @@ if [ "${sync}" = "sync" ]; then
     cmake_flags="${cmake_flags} -DREALM_ENABLE_SYNC=1 -DREALM_ENABLE_SERVER=1 -DOPENSSL_ROOT_DIR=${OPENSSL_ROOT_DIR}"
 fi
 
-cmake ${cmake_flags} -G Ninja -DCMAKE_BUILD_TYPE=Coverage -DDEPENDENCIES_FILE="dependencies${deps_suffix}.list" ..
-ninja -v generate-coverage-cobertura
+cmake ${cmake_flags} -DCMAKE_BUILD_TYPE=Coverage -DDEPENDENCIES_FILE="dependencies${deps_suffix}.list" ..
+make VERBOSE=1 -j${nprocs} generate-coverage-cobertura
 
 find $TMPDIR -name 'realm*' -exec rm -rf "{}" \+ || true

+ 1 - 1
Carthage/Checkouts/realm-cocoa/Realm/RLMRealm+Sync.h

@@ -18,7 +18,7 @@
 
 #import <Foundation/Foundation.h>
 
-#import <Realm/RLMRealm.h>
+#import "RLMRealm.h"
 
 @class RLMResults, RLMSyncSession;
 

+ 1 - 1
Carthage/Checkouts/realm-cocoa/Realm/RLMRealm.h

@@ -17,7 +17,7 @@
 ////////////////////////////////////////////////////////////////////////////
 
 #import <Foundation/Foundation.h>
-#import <Realm/RLMConstants.h>
+#import "RLMConstants.h"
 
 @class RLMRealmConfiguration, RLMRealm, RLMObject, RLMSchema, RLMMigration, RLMNotificationToken, RLMThreadSafeReference, RLMAsyncOpenTask;
 struct RLMRealmPrivileges;

+ 1 - 6
Carthage/Checkouts/realm-cocoa/Realm/RLMRealm.mm

@@ -450,7 +450,7 @@ REALM_NOINLINE static void translateSharedGroupOpenException(NSError **error) {
     }
 
     {
-        Realm::Config const& config = configuration.config;
+        Realm::Config& config = configuration.config;
 
         // try to reuse existing realm first
         if (cache || dynamic) {
@@ -496,11 +496,6 @@ REALM_NOINLINE static void translateSharedGroupOpenException(NSError **error) {
                 throw RLMException(@"Realm opened from incorrect dispatch queue.");
             }
         }
-        else {
-            // If the source config was read from a Realm it may already have a
-            // scheduler, and we don't want to reuse it.
-            config.scheduler = nullptr;
-        }
         realm->_realm = Realm::get_shared_realm(config);
     }
     catch (...) {

+ 1 - 1
Carthage/Checkouts/realm-cocoa/Realm/RLMRealmConfiguration+Sync.h

@@ -18,7 +18,7 @@
 
 #import <Realm/RLMRealmConfiguration.h>
 
-#import <Realm/RLMSyncUtil.h>
+#import "RLMSyncUtil.h"
 
 @class RLMSyncConfiguration;
 

+ 7 - 17
Carthage/Checkouts/realm-cocoa/Realm/RLMRealmConfiguration.h

@@ -79,23 +79,13 @@ typedef BOOL (^RLMShouldCompactOnLaunchBlock)(NSUInteger totalBytes, NSUInteger
 
 /// Whether to open the Realm in read-only mode.
 ///
-/// For non-synchronized Realms, this is required to be able to open Realm
-/// files which are not writeable or are in a directory which is not writeable.
-/// This should only be used on files which will not be modified by anyone
-/// while they are open, and not just to get a read-only view of a file which
-/// may be written to by another thread or process. Opening in read-only mode
-/// requires disabling Realm's reader/writer coordination, so committing a
-/// write transaction from another process will result in crashes.
-///
-/// Syncronized Realms must always be writeable (as otherwise no
-/// synchronization could happen), and this instead merely disallows performing
-/// write transactions on the Realm. In addition, it will skip some automatic
-/// writes made to the Realm, such as to initialize the Realm's schema. Setting
-/// `readOnly = YES` is not strictly required for Realms which the sync user
-/// does not have write access to, but is highly recommended as it will improve
-/// error reporting and catch some errors earlier.
-///
-/// Realms using query-based sync cannot be opened in read-only mode.
+/// This is required to be able to open Realm files which are not writeable or
+/// are in a directory which is not writeable. This should only be used on files
+/// which will not be modified by anyone while they are open, and not just to
+/// get a read-only view of a file which may be written to by another thread or
+/// process. Opening in read-only mode requires disabling Realm's reader/writer
+/// coordination, so committing a write transaction from another process will
+/// result in crashes.
 @property (nonatomic) BOOL readOnly;
 
 /// The current schema version.

+ 4 - 16
Carthage/Checkouts/realm-cocoa/Realm/RLMRealmConfiguration.mm

@@ -205,14 +205,7 @@ static void RLMNSStringToStdString(std::string &out, NSString *in) {
 }
 
 - (BOOL)readOnly {
-    return _config.immutable() || _config.read_only_alternative();
-}
-
-static bool isSync(realm::Realm::Config const& config) {
-#if REALM_ENABLE_SYNC
-    return !!config.sync_config;
-#endif
-    return false;
+    return _config.immutable();
 }
 
 - (void)setReadOnly:(BOOL)readOnly {
@@ -222,15 +215,10 @@ static bool isSync(realm::Realm::Config const& config) {
         } else if (self.shouldCompactOnLaunch) {
             @throw RLMException(@"Cannot set `readOnly` when `shouldCompactOnLaunch` is set.");
         }
-#if REALM_ENABLE_SYNC
-        if (_config.sync_config && _config.sync_config->is_partial) {
-            @throw RLMException(@"Read-only mode is not supported for query-based sync.");
-        }
-#endif
-        _config.schema_mode = isSync(_config) ? realm::SchemaMode::ReadOnlyAlternative : realm::SchemaMode::Immutable;
+        _config.schema_mode = realm::SchemaMode::Immutable;
     }
     else if (self.readOnly) {
-        _config.schema_mode = isSync(_config) ? realm::SchemaMode::Additive : realm::SchemaMode::Automatic;
+        _config.schema_mode = realm::SchemaMode::Automatic;
     }
 }
 
@@ -312,7 +300,7 @@ static bool isSync(realm::Realm::Config const& config) {
 
 - (void)setShouldCompactOnLaunch:(RLMShouldCompactOnLaunchBlock)shouldCompactOnLaunch {
     if (shouldCompactOnLaunch) {
-        if (_config.immutable()) {
+        if (self.readOnly) {
             @throw RLMException(@"Cannot set `shouldCompactOnLaunch` when `readOnly` is set.");
         }
         _config.should_compact_on_launch_function = [=](size_t totalBytes, size_t usedBytes) {

+ 1 - 1
Carthage/Checkouts/realm-cocoa/Realm/RLMSyncCredentials.h

@@ -18,7 +18,7 @@
 
 #import <Foundation/Foundation.h>
 
-#import <Realm/RLMSyncUtil.h>
+#import "RLMSyncUtil.h"
 
 NS_ASSUME_NONNULL_BEGIN
 

+ 1 - 1
Carthage/Checkouts/realm-cocoa/Realm/RLMSyncManager.h

@@ -18,7 +18,7 @@
 
 #import <Foundation/Foundation.h>
 
-#import <Realm/RLMSyncUtil.h>
+#import "RLMSyncUtil.h"
 
 @class RLMSyncSession, RLMSyncTimeoutOptions;
 

+ 1 - 1
Carthage/Checkouts/realm-cocoa/Realm/RLMSyncSession.h

@@ -18,7 +18,7 @@
 
 #import <Foundation/Foundation.h>
 
-#import <Realm/RLMRealm.h>
+#import "RLMRealm.h"
 
 /**
  The current state of the session represented by a session object.

+ 0 - 15
Carthage/Checkouts/realm-cocoa/Realm/RLMSyncSession.mm

@@ -231,21 +231,6 @@ static RLMSyncConnectionState convertConnectionState(SyncSession::ConnectionStat
     return nil;
 }
 
-- (NSString *)description {
-    return [NSString stringWithFormat:
-            @"<RLMSyncSession: %p> {\n"
-            "\tstate = %d;\n"
-            "\tconnectionState = %d;\n"
-            "\trealmURL = %@;\n"
-            "\tuser = %@;\n"
-            "}",
-            (__bridge void *)self,
-            static_cast<int>(self.state),
-            static_cast<int>(self.connectionState),
-            self.realmURL,
-            self.parentUser.identity];
-}
-
 @end
 
 // MARK: - Error action token

+ 3 - 3
Carthage/Checkouts/realm-cocoa/Realm/RLMSyncUser.h

@@ -18,9 +18,9 @@
 
 #import <Foundation/Foundation.h>
 
-#import <Realm/RLMRealmConfiguration.h>
-#import <Realm/RLMSyncCredentials.h>
-#import <Realm/RLMSyncPermission.h>
+#import "RLMRealmConfiguration.h"
+#import "RLMSyncCredentials.h"
+#import "RLMSyncPermission.h"
 
 @class RLMSyncUser, RLMSyncUserInfo, RLMSyncCredentials, RLMSyncPermission, RLMSyncSession, RLMRealm, RLMSyncPermissionOffer;
 

+ 2 - 2
Carthage/Checkouts/realm-cocoa/Realm/Realm-Info.plist

@@ -17,11 +17,11 @@
 	<key>CFBundlePackageType</key>
 	<string>FMWK</string>
 	<key>CFBundleShortVersionString</key>
-	<string>5.3.3</string>
+	<string>5.0.3</string>
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleVersion</key>
-	<string>5.3.3</string>
+	<string>5.0.3</string>
 	<key>NSHumanReadableCopyright</key>
 	<string>Copyright © 2014 Realm. All rights reserved.</string>
 	<key>NSPrincipalClass</key>

+ 0 - 2
Carthage/Checkouts/realm-cocoa/Realm/Tests/KVOTests.mm

@@ -233,7 +233,6 @@ public:
             XCTFail(@"%@", e.description);
         }
         XCTAssertEqual(0U, _notifications.count);
-        static_cast<void>(self); // Pre-12 versions of Xcode require the self variable but 12 doesn't use it
     }
 
     // record a single notification
@@ -242,7 +241,6 @@ public:
         XCTAssertEqual(obj, _obj);
         XCTAssertEqualObjects(key, _keyPath);
         [_notifications addObject:changeDictionary.copy];
-        static_cast<void>(self); // Pre-12 versions of Xcode require the self variable but 12 doesn't use it
     }
 
     // ensure that the observed object is updated for any changes made to the

+ 0 - 1
Carthage/Checkouts/realm-cocoa/Realm/Tests/MigrationTests.mm

@@ -50,7 +50,6 @@ static void RLMAssertRealmSchemaMatchesTable(id self, RLMRealm *realm) {
             XCTAssertEqual(indexed, table->has_search_index(column));
         }
     }
-    static_cast<void>(self);
 }
 
 @interface MigrationTestObject : RLMObject

+ 0 - 21
Carthage/Checkouts/realm-cocoa/Realm/Tests/RealmTests.mm

@@ -1621,27 +1621,6 @@
     });
 }
 
-- (void)testReusingConfigOnMultipleQueues {
-    auto config = [RLMRealmConfiguration defaultConfiguration];
-    auto q1 = dispatch_queue_create("queue 1", DISPATCH_QUEUE_SERIAL);
-    auto q2 = dispatch_queue_create("queue 2", DISPATCH_QUEUE_SERIAL);
-
-    dispatch_sync(q1, ^{
-        XCTAssertNoThrow([RLMRealm realmWithConfiguration:config queue:q1 error:nil]);
-    });
-    dispatch_sync(q2, ^{
-        XCTAssertNoThrow([RLMRealm realmWithConfiguration:config queue:q2 error:nil]);
-    });
-}
-
-- (void)testConfigurationFromExistingRealmOnNewThread {
-    auto r1 = [RLMRealm defaultRealm];
-    [self dispatchAsyncAndWait:^{
-        auto r2 = [RLMRealm realmWithConfiguration:r1.configuration error:nil];
-        XCTAssertNoThrow([r2 refresh]);
-    }];
-}
-
 #pragma mark - In-memory Realms
 
 - (void)testInMemoryRealm {

+ 1 - 1
Carthage/Checkouts/realm-cocoa/RealmSwift.podspec

@@ -26,7 +26,7 @@ Pod::Spec.new do |s|
 
   s.pod_target_xcconfig = { 'APPLICATION_EXTENSION_API_ONLY' => 'YES' }
 
-  s.ios.deployment_target     = '9.0'
+  s.ios.deployment_target     = '8.0'
   s.osx.deployment_target     = '10.9'
   s.watchos.deployment_target = '2.0'
   s.tvos.deployment_target    = '9.0'

+ 70 - 0
Carthage/Checkouts/realm-cocoa/RealmSwift/List.swift

@@ -527,7 +527,11 @@ extension List: RealmCollection {
 
 // MARK: - MutableCollection conformance, range replaceable collection emulation
 extension List: MutableCollection {
+#if swift(>=4.1)
     public typealias SubSequence = Slice<List>
+#else
+    public typealias SubSequence = RandomAccessSlice<List>
+#endif
 
     /**
      Returns the objects at the given range (get), or replaces the objects at the
@@ -594,6 +598,7 @@ extension List: MutableCollection {
             currentIndex += 1
         }
     }
+    #if swift(>=4.1.50)
     /**
      Removes objects from the list at the given range.
 
@@ -605,6 +610,69 @@ extension List: MutableCollection {
             remove(at: bounds.lowerBound)
         }
     }
+    #else
+    /**
+     Removes objects from the list at the given range.
+
+     - warning: This method may only be called during a write transaction.
+     */
+    public func removeSubrange(_ bounds: Range<Int>) {
+        removeSubrange(bounds.lowerBound..<bounds.upperBound)
+    }
+
+    /// :nodoc:
+    public func removeSubrange(_ bounds: ClosedRange<Int>) {
+        removeSubrange(bounds.lowerBound...bounds.upperBound)
+    }
+
+    /// :nodoc:
+    public func removeSubrange(_ bounds: CountableRange<Int>) {
+        for _ in bounds {
+            remove(at: bounds.lowerBound)
+        }
+    }
+
+    /// :nodoc:
+    public func removeSubrange(_ bounds: CountableClosedRange<Int>) {
+        for _ in bounds {
+            remove(at: bounds.lowerBound)
+        }
+    }
+
+    /// :nodoc:
+    public func removeSubrange(_ bounds: DefaultRandomAccessIndices<List>) {
+        removeSubrange(bounds.startIndex..<bounds.endIndex)
+    }
+
+    /// :nodoc:
+    public func replaceSubrange<C: Collection>(_ subrange: ClosedRange<Int>, with newElements: C)
+        where C.Iterator.Element == Element {
+            removeSubrange(subrange)
+            insert(contentsOf: newElements, at: subrange.lowerBound)
+    }
+
+    /// :nodoc:
+    public func replaceSubrange<C: Collection>(_ subrange: CountableRange<Int>, with newElements: C)
+        where C.Iterator.Element == Element {
+            removeSubrange(subrange)
+            insert(contentsOf: newElements, at: subrange.lowerBound)
+    }
+
+    /// :nodoc:
+    public func replaceSubrange<C: Collection>(_ subrange: CountableClosedRange<Int>, with newElements: C)
+        where C.Iterator.Element == Element {
+            removeSubrange(subrange)
+            insert(contentsOf: newElements, at: subrange.lowerBound)
+    }
+
+
+    /// :nodoc:
+    public func replaceSubrange<C: Collection>(_ subrange: DefaultRandomAccessIndices<List>, with newElements: C)
+        where C.Iterator.Element == Element {
+            removeSubrange(subrange)
+            insert(contentsOf: newElements, at: subrange.startIndex)
+    }
+#endif
     /// :nodoc:
     public func remove(atOffsets offsets: IndexSet) {
         for offset in offsets.reversed() {
@@ -632,6 +700,7 @@ extension List: MutableCollection {
 
 // MARK: - Codable
 
+#if swift(>=4.1)
 extension List: Decodable where Element: Decodable {
     public convenience init(from decoder: Decoder) throws {
         self.init()
@@ -650,6 +719,7 @@ extension List: Encodable where Element: Encodable {
         }
     }
 }
+#endif
 
 // MARK: - AssistedObjectiveCBridgeable
 

+ 2 - 0
Carthage/Checkouts/realm-cocoa/RealmSwift/Optional.swift

@@ -65,6 +65,7 @@ public final class RealmOptional<Value: RealmOptionalType>: RLMOptionalBase {
     }
 }
 
+#if swift(>=4.1)
 extension RealmOptional: Codable where Value: Codable {
     public convenience init(from decoder: Decoder) throws {
         self.init()
@@ -78,6 +79,7 @@ extension RealmOptional: Codable where Value: Codable {
         try self.value.encode(to: encoder)
     }
 }
+#endif
 
 internal protocol RealmOptionalProtocol { }
 extension RealmOptional: RealmOptionalProtocol { }

+ 13 - 15
Carthage/Checkouts/realm-cocoa/RealmSwift/RealmConfiguration.swift

@@ -20,6 +20,14 @@ import Foundation
 import Realm
 import Realm.Private
 
+#if !swift(>=4.1)
+fileprivate extension Sequence {
+    func compactMap<T>(_ fn: (Self.Iterator.Element) throws -> T?) rethrows -> [T] {
+        return try flatMap(fn)
+    }
+}
+#endif
+
 extension Realm {
     /**
      A `Configuration` instance describes the different options used to create an instance of a Realm.
@@ -152,21 +160,11 @@ extension Realm {
         /**
          Whether to open the Realm in read-only mode.
 
-         For non-synchronized Realms, this is required to be able to open Realm files which are not
-         writeable or are in a directory which is not writeable.  This should only be used on files
-         which will not be modified by anyone while they are open, and not just to get a read-only
-         view of a file which may be written to by another thread or process. Opening in read-only
-         mode requires disabling Realm's reader/writer coordination, so committing a write
-         transaction from another process will result in crashes.
-
-         Syncronized Realms must always be writeable (as otherwise no synchronization could happen),
-         and this instead merely disallows performing write transactions on the Realm. In addition,
-         it will skip some automatic writes made to the Realm, such as to initialize the Realm's
-         schema. Setting `readOnly = YES` is not strictly required for Realms which the sync user
-         does not have write access to, but is highly recommended as it will improve error reporting
-         and catch some errors earlier.
-
-         Realms using query-based sync cannot be opened in read-only mode.
+         This is required to be able to open Realm files which are not writeable or are in a directory which is not
+         writeable. This should only be used on files which will not be modified by anyone while they are open, and not
+         just to get a read-only view of a file which may be written to by another thread or process. Opening in
+         read-only mode requires disabling Realm's reader/writer coordination, so committing a write transaction from
+         another process will result in crashes.
          */
         public var readOnly: Bool = false
 

+ 2 - 0
Carthage/Checkouts/realm-cocoa/RealmSwift/Results.swift

@@ -413,6 +413,7 @@ extension Results: AssistedObjectiveCBridgeable {
 
 // MARK: - Codable
 
+#if swift(>=4.1)
 extension Results: Encodable where Element: Encodable {
     public func encode(to encoder: Encoder) throws {
         var container = encoder.unkeyedContainer()
@@ -421,3 +422,4 @@ extension Results: Encodable where Element: Encodable {
         }
     }
 }
+#endif

+ 14 - 14
Carthage/Checkouts/realm-cocoa/RealmSwift/Tests/KVOTests.swift

@@ -107,7 +107,7 @@ class KVOTests: TestCase {
         block()
         obj.removeObserver(self, forKeyPath: key)
 
-        XCTAssert(changeDictionary != nil, "Did not get a notification", file: (fileName), line: lineNumber)
+        XCTAssert(changeDictionary != nil, "Did not get a notification", file: fileName, line: lineNumber)
         guard changeDictionary != nil else { return }
 
         let actualOld = changeDictionary![.oldKey]! as? T
@@ -115,10 +115,10 @@ class KVOTests: TestCase {
 
         XCTAssert(old == actualOld,
                   "Old value: expected \(String(describing: old)), got \(String(describing: actualOld))",
-                  file: (fileName), line: lineNumber)
+                  file: fileName, line: lineNumber)
         XCTAssert(new == actualNew,
                   "New value: expected \(String(describing: new)), got \(String(describing: actualNew))",
-                  file: (fileName), line: lineNumber)
+                  file: fileName, line: lineNumber)
 
         changeDictionary = nil
     }
@@ -128,15 +128,15 @@ class KVOTests: TestCase {
         let kvoOptions: NSKeyValueObservingOptions = [.old, .new]
         var gotNotification = false
         let observation = obj.observe(keyPath, options: kvoOptions) { _, change in
-            XCTAssertEqual(change.oldValue, old, file: (fileName), line: lineNumber)
-            XCTAssertEqual(change.newValue, new, file: (fileName), line: lineNumber)
+            XCTAssertEqual(change.oldValue, old, file: fileName, line: lineNumber)
+            XCTAssertEqual(change.newValue, new, file: fileName, line: lineNumber)
             gotNotification = true
         }
 
         block()
         observation.invalidate()
 
-        XCTAssertTrue(gotNotification, file: (fileName), line: lineNumber)
+        XCTAssertTrue(gotNotification, file: fileName, line: lineNumber)
     }
 
     func observeChange<T: Equatable>(_ obj: SwiftKVOObject, _ keyPath: KeyPath<SwiftKVOObject, T?>, _ old: T?, _ new: T?,
@@ -145,14 +145,14 @@ class KVOTests: TestCase {
         var gotNotification = false
         let observation = obj.observe(keyPath, options: kvoOptions) { _, change in
             if let oldValue = change.oldValue {
-                XCTAssertEqual(oldValue, old, file: (fileName), line: lineNumber)
+                XCTAssertEqual(oldValue, old, file: fileName, line: lineNumber)
             } else {
-                XCTAssertNil(old, file: (fileName), line: lineNumber)
+                XCTAssertNil(old, file: fileName, line: lineNumber)
             }
             if let newValue = change.newValue {
-                XCTAssertEqual(newValue, new, file: (fileName), line: lineNumber)
+                XCTAssertEqual(newValue, new, file: fileName, line: lineNumber)
             } else {
-                XCTAssertNil(new, file: (fileName), line: lineNumber)
+                XCTAssertNil(new, file: fileName, line: lineNumber)
             }
             gotNotification = true
         }
@@ -160,7 +160,7 @@ class KVOTests: TestCase {
         block()
         observation.invalidate()
 
-        XCTAssertTrue(gotNotification, file: (fileName), line: lineNumber)
+        XCTAssertTrue(gotNotification, file: fileName, line: lineNumber)
     }
 
     func observeListChange(_ obj: NSObject, _ key: String, _ kind: NSKeyValueChange, _ indexes: NSIndexSet = NSIndexSet(index: 0),
@@ -168,15 +168,15 @@ class KVOTests: TestCase {
         obj.addObserver(self, forKeyPath: key, options: [.old, .new], context: nil)
         block()
         obj.removeObserver(self, forKeyPath: key)
-        XCTAssert(changeDictionary != nil, "Did not get a notification", file: (fileName), line: lineNumber)
+        XCTAssert(changeDictionary != nil, "Did not get a notification", file: fileName, line: lineNumber)
         guard changeDictionary != nil else { return }
 
         let actualKind = NSKeyValueChange(rawValue: (changeDictionary![NSKeyValueChangeKey.kindKey] as! NSNumber).uintValue)!
         let actualIndexes = changeDictionary![NSKeyValueChangeKey.indexesKey]! as! NSIndexSet
-        XCTAssert(actualKind == kind, "Change kind: expected \(kind), got \(actualKind)", file: (fileName),
+        XCTAssert(actualKind == kind, "Change kind: expected \(kind), got \(actualKind)", file: fileName,
             line: lineNumber)
         XCTAssert(actualIndexes.isEqual(indexes), "Changed indexes: expected \(indexes), got \(actualIndexes)",
-                  file: (fileName), line: lineNumber)
+            file: fileName, line: lineNumber)
 
         changeDictionary = nil
     }

+ 10 - 2
Carthage/Checkouts/realm-cocoa/RealmSwift/Tests/ListTests.swift

@@ -19,6 +19,14 @@
 import XCTest
 import RealmSwift
 
+#if !swift(>=4.1)
+extension Sequence {
+    func compactMap<ElementOfResult>(_ transform: (Self.Element) throws -> ElementOfResult?) rethrows -> [ElementOfResult] {
+        return try flatMap(transform)
+    }
+}
+#endif
+
 class ListTests: TestCase {
     var str1: SwiftStringObject?
     var str2: SwiftStringObject?
@@ -196,8 +204,8 @@ class ListTests: TestCase {
         assertEqual(str2, array[0])
         assertEqual(str1, array[1])
 
-        assertThrows(array.insert(str2, at: 200))
-        assertThrows(array.insert(str2, at: -200))
+        assertThrows(_ = array.insert(str2, at: 200))
+        assertThrows(_ = array.insert(str2, at: -200))
     }
 
     func testRemoveAtIndex() {

+ 2 - 2
Carthage/Checkouts/realm-cocoa/RealmSwift/Tests/PrimitiveListTests.swift

@@ -381,8 +381,8 @@ class PrimitiveListTests<O: ObjectFactory, V: ValueFactory>: PrimitiveListTestsB
         XCTAssertEqual(values[0], array[1])
         XCTAssertEqual(values[2], array[2])
 
-        assertThrows(array.insert(values[0], at: 4))
-        assertThrows(array.insert(values[0], at: -1))
+        assertThrows(_ = array.insert(values[0], at: 4))
+        assertThrows(_ = array.insert(values[0], at: -1))
     }
 
     func testRemove() {

+ 13 - 13
Carthage/Checkouts/realm-cocoa/RealmSwift/Tests/RealmTests.swift

@@ -315,7 +315,7 @@ class RealmTests: TestCase {
 
     func testAddSingleObject() {
         let realm = try! Realm()
-        assertThrows(realm.add(SwiftObject()))
+        assertThrows(_ = realm.add(SwiftObject()))
         XCTAssertEqual(0, realm.objects(SwiftObject.self).count)
         var defaultRealmObject: SwiftObject!
         try! realm.write {
@@ -329,7 +329,7 @@ class RealmTests: TestCase {
 
         let testRealm = realmWithTestPath()
         try! testRealm.write {
-            self.assertThrows(testRealm.add(defaultRealmObject))
+            self.assertThrows(_ = testRealm.add(defaultRealmObject))
         }
     }
 
@@ -348,13 +348,13 @@ class RealmTests: TestCase {
 
         let testRealm = realmWithTestPath()
         try! testRealm.write {
-            self.assertThrows(testRealm.add(defaultRealmObject, update: .all))
+            self.assertThrows(_ = testRealm.add(defaultRealmObject, update: .all))
         }
     }
 
     func testAddMultipleObjects() {
         let realm = try! Realm()
-        assertThrows(realm.add([SwiftObject(), SwiftObject()]))
+        assertThrows(_ = realm.add([SwiftObject(), SwiftObject()]))
         XCTAssertEqual(0, realm.objects(SwiftObject.self).count)
         try! realm.write {
             let objs = [SwiftObject(), SwiftObject()]
@@ -365,7 +365,7 @@ class RealmTests: TestCase {
 
         let testRealm = realmWithTestPath()
         try! testRealm.write {
-            self.assertThrows(testRealm.add(realm.objects(SwiftObject.self)))
+            self.assertThrows(_ = testRealm.add(realm.objects(SwiftObject.self)))
         }
     }
 
@@ -381,7 +381,7 @@ class RealmTests: TestCase {
 
         let testRealm = realmWithTestPath()
         try! testRealm.write {
-            self.assertThrows(testRealm.add(realm.objects(SwiftPrimaryStringObject.self), update: .all))
+            self.assertThrows(_ = testRealm.add(realm.objects(SwiftPrimaryStringObject.self), update: .all))
         }
     }
 
@@ -390,24 +390,24 @@ class RealmTests: TestCase {
     func testDeleteSingleObject() {
         let realm = try! Realm()
         XCTAssertEqual(0, realm.objects(SwiftObject.self).count)
-        assertThrows(realm.delete(SwiftObject()))
+        assertThrows(_ = realm.delete(SwiftObject()))
         var defaultRealmObject: SwiftObject!
         try! realm.write {
             defaultRealmObject = SwiftObject()
-            self.assertThrows(realm.delete(defaultRealmObject))
+            self.assertThrows(_ = realm.delete(defaultRealmObject))
             XCTAssertEqual(0, realm.objects(SwiftObject.self).count)
             realm.add(defaultRealmObject)
             XCTAssertEqual(1, realm.objects(SwiftObject.self).count)
             realm.delete(defaultRealmObject)
             XCTAssertEqual(0, realm.objects(SwiftObject.self).count)
         }
-        assertThrows(realm.delete(defaultRealmObject))
+        assertThrows(_ = realm.delete(defaultRealmObject))
         XCTAssertEqual(0, realm.objects(SwiftObject.self).count)
 
         let testRealm = realmWithTestPath()
-        assertThrows(testRealm.delete(defaultRealmObject))
+        assertThrows(_ = testRealm.delete(defaultRealmObject))
         try! testRealm.write {
-            self.assertThrows(testRealm.delete(defaultRealmObject))
+            self.assertThrows(_ = testRealm.delete(defaultRealmObject))
         }
     }
 
@@ -425,9 +425,9 @@ class RealmTests: TestCase {
         XCTAssertEqual(0, realm.objects(SwiftObject.self).count)
 
         let testRealm = realmWithTestPath()
-        assertThrows(testRealm.delete(objs))
+        assertThrows(_ = testRealm.delete(objs))
         try! testRealm.write {
-            self.assertThrows(testRealm.delete(objs))
+            self.assertThrows(_ = testRealm.delete(objs))
         }
     }
 

+ 11 - 11
Carthage/Checkouts/realm-cocoa/RealmSwift/Tests/TestCase.swift

@@ -104,13 +104,13 @@ class TestCase: RLMTestCaseBase {
             return
         }
         XCTFail("Objects expected to be equal, but weren't. First: \(String(describing: o1)), "
-            + "second: \(String(describing: o2))", file: (fileName), line: lineNumber)
+            + "second: \(String(describing: o2))", file: fileName, line: lineNumber)
     }
 
     /// Check whether two collections containing Realm objects are equal.
     func assertEqual<C: Collection>(_ c1: C, _ c2: C, fileName: StaticString = #file, lineNumber: UInt = #line)
         where C.Iterator.Element: Object {
-            XCTAssertEqual(c1.count, c2.count, "Collection counts were incorrect", file: (fileName), line: lineNumber)
+            XCTAssertEqual(c1.count, c2.count, "Collection counts were incorrect", file: fileName, line: lineNumber)
             for (o1, o2) in zip(c1, c2) {
                 assertEqual(o1, o2, fileName: fileName, lineNumber: lineNumber)
             }
@@ -119,14 +119,14 @@ class TestCase: RLMTestCaseBase {
     func assertEqual<T: Equatable>(_ expected: [T?], _ actual: [T?], file: StaticString = #file, line: UInt = #line) {
         if expected.count != actual.count {
             XCTFail("assertEqual failed: (\"\(expected)\") is not equal to (\"\(actual)\")",
-                file: (file), line: line)
+                file: file, line: line)
             return
         }
 
-        XCTAssertEqual(expected.count, actual.count, "Collection counts were incorrect", file: (file), line: line)
+        XCTAssertEqual(expected.count, actual.count, "Collection counts were incorrect", file: file, line: line)
         for (e, a) in zip(expected, actual) where e != a {
             XCTFail("assertEqual failed: (\"\(expected)\") is not equal to (\"\(actual)\")",
-                file: (file), line: line)
+                file: file, line: line)
             return
         }
     }
@@ -155,7 +155,7 @@ class TestCase: RLMTestCaseBase {
             try block()
         } catch {
             XCTFail("Expected no error, but instead caught <\(error)>.",
-                file: (fileName), line: lineNumber)
+                file: fileName, line: lineNumber)
         }
     }
 
@@ -165,12 +165,12 @@ class TestCase: RLMTestCaseBase {
         do {
             _ = try block()
             XCTFail("Expected to catch <\(expectedError)>, but no error was thrown.",
-                file: (fileName), line: lineNumber)
+                file: fileName, line: lineNumber)
         } catch let e as Realm.Error where e.code == expectedError {
             // Success!
         } catch {
             XCTFail("Expected to catch <\(expectedError)>, but instead caught <\(error)>.",
-                file: (fileName), line: lineNumber)
+                file: fileName, line: lineNumber)
         }
     }
 
@@ -180,18 +180,18 @@ class TestCase: RLMTestCaseBase {
         do {
             _ = try block()
             XCTFail("Expected to catch <\(expectedError)>, but no error was thrown.",
-                file: (fileName), line: lineNumber)
+                file: fileName, line: lineNumber)
         } catch let e where e._code == expectedError._code {
             // Success!
         } catch {
             XCTFail("Expected to catch <\(expectedError)>, but instead caught <\(error)>.",
-                file: (fileName), line: lineNumber)
+                file: fileName, line: lineNumber)
         }
     }
 
     func assertNil<T>(block: @autoclosure() -> T?, _ message: String? = nil,
                       fileName: StaticString = #file, lineNumber: UInt = #line) {
-        XCTAssert(block() == nil, message ?? "", file: (fileName), line: lineNumber)
+        XCTAssert(block() == nil, message ?? "", file: fileName, line: lineNumber)
     }
 
     func assertMatches(_ block: @autoclosure () -> String, _ regexString: String, _ message: String? = nil,

+ 39 - 16
Carthage/Checkouts/realm-cocoa/build.sh

@@ -557,6 +557,11 @@ case "$COMMAND" in
         ;;
 
     "catalyst")
+        if (( $(xcode_version_major) < 11 )); then
+            echo 'Building for Catalyst requires Xcode 11'
+            exit 1
+        fi
+
         xc "-scheme Realm -configuration $CONFIGURATION \
             REALM_CATALYST_FLAGS='-target x86_64-apple-ios13.0-macabi' \
             REALM_PLATFORM_SUFFIX='maccatalyst' \
@@ -565,6 +570,11 @@ case "$COMMAND" in
         ;;
 
     "catalyst-swift")
+        if (( $(xcode_version_major) < 11 )); then
+            echo 'Building for Catalyst requires Xcode 11'
+            exit 1
+        fi
+
         sh build.sh catalyst
         # FIXME: change this to just "-destination variant='Mac Catalyst'" once the CI machines are running 10.15
         xc "-scheme 'RealmSwift' -configuration $CONFIGURATION build \
@@ -580,6 +590,11 @@ case "$COMMAND" in
         ;;
 
     "xcframework")
+        if (( $(xcode_version_major) < 11 )); then
+            echo 'Building a xcframework requires Xcode 11'
+            exit 1
+        fi
+
         export REALM_EXTRA_BUILD_ARGUMENTS="$REALM_EXTRA_BUILD_ARGUMENTS BUILD_LIBRARY_FOR_DISTRIBUTION=YES REALM_OBJC_MACH_O_TYPE=staticlib"
 
         # Build all of the requested frameworks
@@ -745,8 +760,10 @@ case "$COMMAND" in
         sh build.sh test-tvos-devices || failed=1
         sh build.sh test-osx || failed=1
         sh build.sh test-osx-swift || failed=1
-        sh build.sh test-catalyst || failed=1
-        sh build.sh test-catalyst-swift || failed=1
+        if (( $(xcode_version_major) >= 11 )); then
+            sh build.sh test-catalyst || failed=1
+            sh build.sh test-catalyst-swift || failed=1
+        fi
         exit $failed
         ;;
 
@@ -885,8 +902,10 @@ case "$COMMAND" in
         sh build.sh verify-swiftlint
         sh build.sh verify-swiftpm
         sh build.sh verify-osx-object-server
-        sh build.sh verify-catalyst
-        sh build.sh verify-catalyst-swift
+        if (( $(xcode_version_major) >= 11 )); then
+            sh build.sh verify-catalyst
+            sh build.sh verify-catalyst-swift
+        fi
         ;;
 
     "verify-cocoapods")
@@ -1202,6 +1221,16 @@ case "$COMMAND" in
     # CocoaPods
     ######################################
     "cocoapods-setup")
+        if [ ! -d core ]; then
+          sh build.sh download-sync
+          rm core
+          mv sync-* core
+          mv core/librealm-ios.a core/librealmcore-ios.a
+          mv core/librealm-macosx.a core/librealmcore-macosx.a
+          mv core/librealm-tvos.a core/librealmcore-tvos.a
+          mv core/librealm-watchos.a core/librealmcore-watchos.a
+        fi
+
         if [[ "$2" != "swift" ]]; then
           if [ ! -d Realm/ObjectStore/src ]; then
             cat >&2 <<EOM
@@ -1217,16 +1246,6 @@ EOM
             exit 1
           fi
 
-          if [ ! -d core ]; then
-            sh build.sh download-sync
-            rm core
-            mv sync-* core
-            mv core/librealm-ios.a core/librealmcore-ios.a
-            mv core/librealm-macosx.a core/librealmcore-macosx.a
-            mv core/librealm-tvos.a core/librealmcore-tvos.a
-            mv core/librealm-watchos.a core/librealmcore-watchos.a
-          fi
-
           rm -rf include
           mkdir -p include
           mv core/include include/core
@@ -1388,7 +1407,11 @@ EOM
 
         set_xcode_and_swift_versions
 
-        sh build.sh $PLATFORM-swift
+        if [[ "$PLATFORM" = "catalyst" ]] && (( $(xcode_version_major) < 11 )); then
+            mkdir -p build/catalyst/swift-$REALM_XCODE_VERSION
+        else
+            sh build.sh $PLATFORM-swift
+        fi
 
         cd build/$PLATFORM
         zip --symlinks -r realm-framework-$PLATFORM-$REALM_XCODE_VERSION.zip swift-$REALM_XCODE_VERSION
@@ -1544,7 +1567,7 @@ x.y.z Release notes (yyyy-MM-dd)
 * Realm Object Server: 3.21.0 or later.
 * Realm Studio: 3.11 or later.
 * APIs are backwards compatible with all previous releases in the 5.x.y series.
-* Carthage release for Swift is built with Xcode 11.6.
+* Carthage release for Swift is built with Xcode 11.5.
 
 ### Internal
 * Upgraded realm-core from ? to ?

+ 3 - 3
Carthage/Checkouts/realm-cocoa/dependencies.list

@@ -1,4 +1,4 @@
-VERSION=5.3.3
-REALM_CORE_VERSION=6.0.14
-REALM_SYNC_VERSION=5.0.14
+VERSION=5.0.3
+REALM_CORE_VERSION=6.0.6
+REALM_SYNC_VERSION=5.0.5
 REALM_OBJECT_SERVER_VERSION=3.28.5

+ 8 - 10
Carthage/Checkouts/realm-cocoa/examples/installation/build.sh

@@ -40,6 +40,9 @@ command:
   test-watchos-swift-xcframework:  tests watchOS Swift xcframework example.
   test-watchos-swift-cocoapods:    tests watchOS Swift CocoaPods example.
   test-watchos-swift-carthage:     tests watchOS Swift Carthage example.
+  test-watchos-spm:                tests watchOS Swift Package Manager example.
+
+  test-tvos-spm:                   tests tvOS Swift Package Manager example.
 EOF
 }
 
@@ -164,9 +167,11 @@ case "$COMMAND" in
         for target in ios-swift-dynamic ios-swift-cocoapods osx-swift-dynamic ios-swift-carthage osx-swift-carthage; do
             ./build.sh test-$target || exit 1
         done
-        for target in ios osx; do
-            ./build.sh test-$target-spm || exit 1
-        done
+        if (( $(xcode_version_major) >= 11 )); then
+            for target in ios osx watchos tvos; do
+                ./build.sh test-$target-spm || exit 1
+            done
+        fi
         ;;
 
     test-*-*-cocoapods)
@@ -194,13 +199,6 @@ case "$COMMAND" in
         ;;
 
     test-ios-spm)
-        # We have to "hide" the spm example from carthage because otherwise
-        # it'll fetch the example's package dependencies as part of deciding
-        # what to build from this repo.
-        if ! [ -L ios/swift/SwiftPackageManagerExample/SwiftPackageManagerExample.xcodeproj/project.pbxproj ]; then
-            mkdir -p ios/swift/SwiftPackageManagerExample/SwiftPackageManagerExample.xcodeproj
-            ln -s ../project.pbxproj ios/swift/SwiftPackageManagerExample/SwiftPackageManagerExample.xcodeproj
-        fi
         xctest "$PLATFORM" swift SwiftPackageManagerExample
         ;;
 

+ 1 - 1
Carthage/Checkouts/realm-cocoa/examples/installation/ios/objc/CocoaPodsDynamicExample/Podfile

@@ -1,5 +1,5 @@
 # Uncomment this line to define a global platform for your project
-platform :ios, '9.0'
+# platform :ios, '6.0'
 
 use_frameworks!
 branch = ENV['sha']

+ 1 - 1
Carthage/Checkouts/realm-cocoa/examples/installation/ios/objc/CocoaPodsExample/Podfile

@@ -1,5 +1,5 @@
 # Uncomment this line to define a global platform for your project
-platform :ios, '9.0'
+# platform :ios, '6.0'
 
 branch = ENV['sha']
 

+ 1 - 1
Carthage/Checkouts/realm-cocoa/examples/installation/ios/swift/CocoaPodsExample/Podfile

@@ -1,5 +1,5 @@
 # Uncomment this line to define a global platform for your project
-platform :ios, '9.0'
+# platform :ios, '6.0'
 
 branch = ENV['sha']
 

+ 1 - 1
Carthage/Checkouts/realm-cocoa/examples/ios/objc/Podfile

@@ -1,4 +1,4 @@
-platform :ios, '9.0'
+platform :ios, '7.0'
 
 target 'RACTableView' do
   pod 'ReactiveCocoa', :inhibit_warnings => true

+ 1 - 1
Carthage/Checkouts/realm-cocoa/scripts/package_examples.rb

@@ -41,7 +41,7 @@ base_examples = [
   "examples/tvos/swift",
 ]
 
-xcode_versions = %w(11.3 11.4.1 11.5 11.6)
+xcode_versions = %w(10.3 11.1 11.2.1 11.3 11.4.1 11.5)
 
 # Remove reference to Realm.xcodeproj from all example workspaces.
 base_examples.each do |example|

+ 3 - 5
Carthage/Checkouts/realm-cocoa/scripts/reset-simulators.rb

@@ -141,11 +141,9 @@ begin
         end
       end
 
-      # Not all runtime and device pairs are valid as newer simulator runtimes
-      # don't support older devices. The exact error code for this changes
-      # every few versions of Xcode, so this just lists all the ones we've
-      # seen.
-      next if /domain=com.apple.CoreSimulator.SimError, code=(?<code>\d+)/ =~ output and [161, 162, 163, 403].include? code.to_i
+      # Error code 161-163 indicate that the given device is not supported by the runtime, such as the iPad 2 and
+      # iPhone 4s not being supported by the iOS 10 simulator runtime.
+      next if output =~ /(domain=com.apple.CoreSimulator.SimError, code=16[123])/
 
       puts "Failed to create device of type #{device_type['identifier']} with runtime #{runtime['identifier']}:"
       output.each_line do |line|

+ 1 - 0
iOSClient/Supporting Files/en.lproj/Localizable.strings

@@ -538,6 +538,7 @@
 "_share_can_change_"            = "Can change";
 "_share_can_delete_"            = "Can delete";
 "_share_unshare_"               = "Unshare";
+"_share_internal_link_"         = "Share internal link";
 
 // Share Permission