Conversation
This resolves a string overflow issue that appeared in tests in Xcode 15.0.1
Apple requires user interaction to allow using the pasteboard – this change allows us to mock the pasteboard while under test to avoid that
|
|
||
| func isValidIndex(_ index: String.UTF16View.Index) -> Bool { | ||
| (self.startIndex ... self.endIndex).contains(index) | ||
| } |
There was a problem hiding this comment.
The endIndex is not an accessible index.
A string’s “past the end” position—that is, the position one greater than the last valid subscript argument.
| } | ||
|
|
||
| func isValidIndex(_ index: String.UTF16View.Index) -> Bool { | ||
| (self.startIndex ... self.endIndex).contains(index) |
There was a problem hiding this comment.
| (self.startIndex ... self.endIndex).contains(index) | |
| (self.startIndex ..< self.endIndex).contains(index) |
.buildkite/pipeline.yml
Outdated
| # post a message in the logs | ||
| cat .buildkite/validate_podspec_annotation.md | ||
| # and also as an annotation | ||
| cat .buildkite/validate_podspec_annotation.md | buildkite-agent annotate --style 'warning' |
There was a problem hiding this comment.
There is a new workaround for this issue: You can pass a --patch-cocoapods option to validate_podspec and the publish pod utilities. See https://github.com/wordpress-mobile/WordPressKit-iOS/pull/652/files.
b7d60ed to
5f76bb3
Compare
crazytonyli
left a comment
There was a problem hiding this comment.
Maybe updating the publishing pod commands in.buildkite/publish-aztec-pod.sh too, with the same --patch-cocoapods option? Otherwise, future releasing jobs would fail.
.buildkite/pipeline.yml
Outdated
| env: *common_env | ||
| plugins: *common_plugins | ||
| agents: | ||
| queue: upload |
There was a problem hiding this comment.
This agents configuration needs to be removed.
5f76bb3 to
4436946
Compare
|
|
||
| open override func cut(_ sender: Any?) { | ||
| let data = storage.attributedSubstring(from: selectedRange).archivedData() | ||
| let data = try! storage.attributedSubstring(from: selectedRange).archivedData() |
There was a problem hiding this comment.
Does that mean this line crashes if the selected attributed string contains an "attribute value" that doesn't conform to NSCoding? I don't really know anything about this library's implementation, not sure how likely that's going to happen...
There was a problem hiding this comment.
That's a good question, but also before the migration to Xcode 15 and newer Swift back when archivedData was not marked as throws, I'd expect the code would already crash (but maybe with an ObjC NSException rather than a Swift error being thrown)?
That being said, it would be a nice improvement to use let data = try? … instead and then make the subsequent call to storeInPasteboard(encoded: data) conditional on if let data; but not sure if that fix belongs in this PR or separate.
There was a problem hiding this comment.
Also, looking at the deprecated vs new method signature for NSKeyedArchiver.archivedData, I'm wondering if the only case where it could throw is if you passed requiresSecureCoding: true and the objects conformed to NSCoding… but not NSSecureCoding.
But since here we use requiresSecureCoding: false in the implementation of archivedData, maybe that means we'll never throw in practice? Or if we do, that would be under the same conditions as the ones the current version of the library already does, i.e. not related to Xcode 13->Xcode15 migration?
|
Breadcrumbs: I reverted the attribution of the cluster to this repo in Buildkite (https://github.com/Automattic/buildkite-ci/pull/331) — aka reverted this repo to use Intel infra — while this PR is still not merged. Once we land this PR, don't forget to redo the change in |
|
I wanted to help here and tried to address the unit tests failures via #1382 but didn't get very far. |
Migrates the project to Xcode 15 and Apple Silicon in CI
Also includes:
UITextViewsubclass that injects aUIPasteboardobject. This allows us to mock access to the system pasteboard, which requires user interaction in recent iOS versionsThis can be reviewed by anyone, but I'd appreciate if @mokagio or @crazytonyli took a look at the project code adjustments!
Testing Details
Ensure CI passes
CHANGELOG.mdif necessary.