Skip to content

Conversation

@ih-codes
Copy link
Collaborator

@ih-codes ih-codes commented Sep 18, 2025

📜 Tickets

Jira ticket
Github issue

💡 Description

Fix or suppress Sendable warnings in MozillaRustComponents.

I'm just checking if this can satisfy Bitrise or if we're going to run into issues...

P.S. I opened the MozillaRustComponents package folder inside Xcode (instead of Client), and switched the package file to compile with 5.10 and the strict concurrency flags. I then had to delete Derived Data before I started seeing warnings properly in Xcode 26 release build. I had more issues in Xcode 26 RC.

cc @Cramsden @lmarceau @dataports | Swift 6 Migration

📝 Checklist

  • I filled in the ticket numbers and a description of my work
  • I updated the PR name to follow our PR naming guidelines
  • I ensured unit tests pass and wrote tests for new code
  • If working on UI, I checked and implemented accessibility (Dynamic Text and VoiceOver)
  • If adding telemetry, I read the data stewardship requirements and will request a data review
  • If needed, I updated documentation and added comments to complex code
  • If needed, I added a backport comment (example @Mergifyio backport release/v150.0)

public static func string(for keys: [Int32]) throws -> String {
let optionalString = try data(for: keys).withUnsafeBufferPointer { dataPointer -> String? in
dataPointer.baseAddress.flatMap { String(validatingUTF8: $0) }
dataPointer.baseAddress.flatMap { String(validatingCString: $0) }
Copy link
Contributor

Choose a reason for hiding this comment

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

Why was this change necessary?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good eye! This has nothing to do with strict concurrency, but Xcode was showing me a deprecation warning and auto fixed to change to this version. 👀

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok wanted to double-check! Works for me 👍

@ih-codes ih-codes force-pushed the ih/FXIOS-13502-MozillaRustComponents-Fix-Sendable-warnings branch from f2dee42 to 5cd7e80 Compare September 19, 2025 19:52
@ih-codes
Copy link
Collaborator Author

This change causes some warnings in the Client/Generated folder. On Monday I have a meeting to investigate how we can get the generated code to add @unchecked Sendable so we can unblock this work.

@ih-codes
Copy link
Collaborator Author

PR submitted to AS to add @unchecked Sendable to the Client/Generated code to unblock this PR: mozilla/application-services#6963

@ih-codes
Copy link
Collaborator Author

PR has been merged so we should be able to pull in the changes via AS in the next day or two to unblock us on these warnings in the Client/Generated folder.

@ih-codes ih-codes changed the base branch from main to epic-branch/swift-migration September 24, 2025 18:18
@ih-codes ih-codes force-pushed the epic-branch/swift-migration branch 2 times, most recently from e24998a to a78b477 Compare September 25, 2025 21:00
@ih-codes ih-codes force-pushed the ih/FXIOS-13502-MozillaRustComponents-Fix-Sendable-warnings branch from 5cd7e80 to d4e989f Compare September 25, 2025 21:01
@ih-codes
Copy link
Collaborator Author

ih-codes commented Sep 25, 2025

@issammani accepted the AS changes here: #29585

Going to rebase and see where we're at! Hopefully the Client/Generated warnings are resolved now.

@mobiletest-ci-bot
Copy link

🥇 Perfect PR size

Smaller PRs are easier to review. Thanks for making life easy for reviewers! ✨

💬 Description craftsman

Great PR description! Reviewers salute you 🫡

Generated by 🚫 Danger Swift against d4e989f

@ih-codes ih-codes merged commit ac31f66 into epic-branch/swift-migration Sep 26, 2025
8 checks passed
@ih-codes ih-codes deleted the ih/FXIOS-13502-MozillaRustComponents-Fix-Sendable-warnings branch September 26, 2025 20:30
ih-codes added a commit that referenced this pull request Sep 26, 2025
… from last week (#5) (#29657)

* Refactor FXIOS-13511 [Swift 6] Remove Equatable from AppState and other redux states (#29495)

* Remove unneeded equatable conformance on redux states

* Fix tests

* Fix test

* Refactor FXIOS-13532 [Swift 6 Migration] Fix strict concurrency errors related to Notifications  (#29514)

Fun stuff

* Refactor FXIOS-13502 [Swift 6 Migration] Fix main actor isolation warnings in MozillaRustComponents (#29426)

"Fix" main actor isolation warnings in MozillaRustComponents with a workaround for setting accessibility identifiers to prevent larger impacts and errors in Client generated code.

* Refactor FXIOS-13511 [Swift 6] Move Tab to MainActor and resolve strict concurrency warnings (#29497)

* Refactor FXIOS-13511 [Swift 6] Remove Equatable from AppState and other redux states (#29495)

* Remove unneeded equatable conformance on redux states

* Fix tests

* Fix test

* Refactor FXIOS-13532 [Swift 6 Migration] Fix strict concurrency errors related to Notifications  (#29514)

Fun stuff

* first pass of isolating tab to the main actor

* Clean up tests and push commented out code

* fix additional warnings

* Clean up remaining warnings

* fix tests

* add missing ticket numbers

* resolve introduced warning

---------

Co-authored-by: lmarceau <lmarceau@mozilla.com>

* Refactor FXIOS-13532 #29411 [Swift 6 Migration] AppDelegate + PushNotification (#29590)

* Fix for Constellation update

* Fix UNUserNotificationCenterDelegate methods

* Fix tests

* Refactor FXIOS-13235 [Swift 6 Migration] Enable strict concurrency checking in SummarizerKit (#29575)

* Enable strict concurrency in SummarizerKit.

* Fix closure `Sendable` warnings.

* Fix some other warnings. Suppress others with FIXME tickets.

* Refactor FXIOS-13463 #29256 [Swift 6 Migration] WebEngine @mainactor (#29393)

* Policy decider

* Make main actor

* @mainactor stuff

* Fix the tests

* Adjust Client

* Add ticket number

* Adjust following comments

* Refactor FXIOS-12796 [Swift 6 Migration] Fix more under-specified protocols (#29650)

* Fix under-specified protocols: AddressToolbarDelegate, EmptyPrivateTabView, InsetUpdatable, PhotonActionSheetContainerCellDelegate, NavigationController.

* Fix unit tests.

* Refactor FXIOS-13502 [Swift 6 Migration] Fix or suppress `Sendable` and misc. warnings in MozillaRustComponents (round 1) (#29425)

* Fix or suppress Sendable warnings in MozillaRustComponents.

* Janky workaround for main actor isolation warning.

* Update some Rust Components Sendable callbacks with @mainactor as well so the Client can reason better about main actor isolation.

* Refactor FXIOS-13511 [Swift 6] Additional Strict Concurrency Clean up for Tab and Friends (#29628)

* Additional tab clean up

* Isolate UserScriptManager to main actor

* fix tests

* turn off strict concurrency

* more main actor isolation

* resolve introduced warnings

---------

Co-authored-by: Carson Ramsden <carsonramsden@gmail.com>
Co-authored-by: lmarceau <lmarceau@mozilla.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants