Repository navigation
[GameKit] Fix GKTurnBasedMatch decline invite callback binding - #26813
Conversation
Compile the repository's API-definition and binding-attribute assemblies with full nullable context, matching the already-enabled core and platform assemblies. Restore the inherited context after Foundation's locally annotated callback and remove an obsolete HealthKit warning suppression. Enable annotations in both bgen's fallback compilation and the binding-project MSBuild target without imposing new nullable warnings on consuming projects. This covers direct csc response files and the separate binding-tool routes while keeping generated bindings buildable across all four platforms. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Put -nullable+ in DOTNET_FLAGS so core, platform, API-definition, and binding-attribute compiler invocations use the same setting. Remove redundant switches from the core and platform response files and the attribute-library command; keep it in the API-definition response files because they are separately consumed by generated analysis projects. Track changes to Makefile when deciding whether to rebuild the binding-attribute assembly, so a future change to shared compiler flags also recompiles that direct-csc output. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Document ten active Network enums and all 42 of their values, with one commit for each type. Remove the corresponding 42 Cecil documentation known-failure entries. 🤖 Pull request created by Copilot --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Annotate both view controller and error as nullable in the local player's authentication handler for iOS, Mac Catalyst, tvOS, and macOS. Keep the existing nullable handler contract while the file is not yet nullable-enabled. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Match the nullable result and error parameters declared by GameKit's SDK headers across its completion callbacks. Keep enum and value-type arguments nonnullable, and annotate the optional best-host responses as nullable. With PR #26746 enabling nullable annotations in API definitions globally, these annotations flow through bgen without local nullable directives. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Remove the now-obsolete missing-null-allowed entries for GameKit callbacks and the local-player authentication handler. The managed annotations now match the nullable callback arguments in the native headers across Apple platforms. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Mark the image, photo, and challenge-definition results nullable in the named GameKit completion delegates, matching the native SDK headers. Remove the resolved xtro suppressions and delete the platform ignore files that are now empty. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Restore the existing DeclineInvite callback contract and its xtro suppression. Apple's native completion block has a different arity, which requires a separate compatibility-safe binding fix rather than a nullable annotation in this PR. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…layer-handler-nullability
Bind the native NSError-only completion handler and expose a separate correctly typed callback and Task API. Keep the shipped two-argument DeclineInvite method virtual and forward it through the corrected binding so existing binaries, overrides, and null-handler calls continue to work; reserve the corrected name for XAMCORE_5_0. Remove the obsolete xtro suppression and verify both API shapes across Apple platforms with Cecil tests. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The legacy adapter has incorrect nullability annotations and is not marked obsolete according to established compatibility conventions.
Review effort: Balanced
Findings: 1
Open (2)
What changed in this PR
Corrects GKTurnBasedMatch invite-decline callback marshalling while preserving the legacy API.
Changes:
- Adds the corrected callback binding and compatibility adapter.
- Adds Cecil regression coverage and removes the xtro suppression.
| File | Description |
|---|---|
src/gamekit.cs |
Corrects callback binding and adds legacy forwarding. |
tests/cecil-tests/ApiTest.cs |
Verifies native and compatibility signatures. |
tests/xtro-sharpie/api-annotations-dotnet/common-GameKit.ignore |
Removes the resolved suppression. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Hide the compatibility overload from completion while preserving its existing virtual signature. Remove its documentation exception now that obsolete hidden members no longer require coverage, and assert both attributes in the Cecil API regression test.\n\nCo-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Assert that the generated asynchronous compatibility method inherits both the obsolescence notice and IntelliSense hiding on every Apple platform, so future binding generator changes cannot expose the misleading API again. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Blocking until #26811 is merged (at which point this PR will have to be retargetted to main, and main probably also merged into this branch). |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Reconcile the nullable GameKit deprecation message with upstream and remove the now-obsolete GameKit xtro suppression file. Retain the compatibility-preserving DeclineInvite binding while incorporating the latest main branch changes. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
🔥 [CI Build #c111ea8] Test results 🔥Test results❌ Tests failed on VSTS: test results 1 tests crashed, 1 tests failed, 213 tests passed. Failures❌ dotnettests tests (macOS)1 tests failed, 0 tests passed.Failed tests
Html Report (VSDrops) Download ❌ windows tests🔥 Failed catastrophically on VSTS: test results - windows (no summary found). Html Report (VSDrops) Download Successes✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download macOS tests✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download Linux Build VerificationPipeline on Agent |
|
Update the branch against the latest target before evaluating the Cecil review feedback. Preserve upstream changes, including the removed Xamarin.MacDev submodule. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🔵 Needs a closer look
The legacy callback incorrectly declares non-nullable arguments despite receiving null, causing the generated async method to promise a non-nullable result that is always null while null-forgiving operators conceal the mismatch.
No open issues 🎉
1 resolved since last review
Review effort: Balanced
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
🚀 [CI Build #1a7e296] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 197 tests passed 🎉 Tests counts✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download macOS tests✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download Linux Build VerificationPipeline on Agent |
Preserve the GKChallengeState deprecation baseline added by this branch. Retain main's removal of the obsolete DeclineInvite callback suppression after its binding correction in #26813. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8a4efa71-7937-4254-83a8-0fa09ae5190b


Apple's
GKTurnBasedMatch.declineInviteWithCompletionHandler:invokes its completion block with only a nullableNSError. The existing binding incorrectly expects both a match and an error, so invoking the callback can use the wrong native block signature.Bind the native selector to
Action<NSError?>and exposeDeclineInviteWithError/DeclineInviteWithErrorAsync. Preserve the existing virtual two-argumentDeclineInviteandDeclineInviteAsyncsignatures for source and binary compatibility by forwarding through the corrected binding; the legacy match argument is null. UnderXAMCORE_5_0, the corrected signature takes theDeclineInvitename. Remove the obsolete xtro suppression.🤖 Pull request created by Copilot