chore: await or forget abandoned async calls#9044
Conversation
|
Windows and Mac build successful in Unity Cloud! You can find a link to the downloadable artifact below. |
|
Claude finished @NickKhalow's task in 3m 2s —— View job PR Review
SummaryWhat this PR solves: CS4014 (un-awaited No Blocking Issues FoundAll 13 files pass review:
Non-Blocking Note
REVIEW_RESULT: PASS ✅ |
|
🔍 Claude reviewed this PR and found no blocking issues, but assessed it as complex — human DEV review is still required before merging. |
|
✅ PR reviewed and approved by QA on Mac following the PR test instructions. Build: Test results:
Unrelated errors noted (do not affect verdict):
Verdict: PASS ✅
22.06.2026_17.46.04_REC.mp4 |
Ludmilafantaniella
left a comment
There was a problem hiding this comment.
Tested on Windows and Mac. ✅
Smoke test passed with no regressions. App boots normally, friends subscriptions work, map layers populate correctly, voice chat microphone publishing works, and /scene-admins command returns the admin list as expected. LGTM 🚀
| // suppress CS1998 on other platforms. | ||
| #if !UNITY_STANDALONE_OSX | ||
| #pragma warning disable CS1998 | ||
| #endif |
There was a problem hiding this comment.
Not very happy with this one but I guess there's no other way given the OSX specifics inside the method.
Pull Request Description
What does this PR change?
Fixes abandoned / mislabeled async calls surfaced by the compiler warnings CS4014 (call not awaited) and CS1998 (async method without
await). These are correctness/readability hazards: un-awaited tasks run detached with unobserved exceptions, andasyncmethods with noawaitallocate a state machine while running synchronously and misleading the reader.CS4014 — un-awaited calls (now explicitly
.Forget()):PluginSystem/Global/FriendsContainer.cs—LaunchSubscriptionsAsync(...)was fire-and-forget without.Forget(); now matches the siblingPrewarmAsync(...).Forget()in the same method.RestrictedActions/Tests/GlobalWorldActionsShould.cs(×4) —TriggerSceneEmoteAsync(...)calls; the tests assert the synchronous side effects, so.Forget()makes the fire-and-forget intent explicit.CS1998 —
asyncmethods with noawait(converted to non-asyncUniTask-returning):InitializeAsync/EnableAsyncin the MapRenderer layer controllers (CategoryMarkersController,LiveEventsMarkersController,ScenesOfInterestMarkersController,SearchResultMarkersController) andAudioAnalysisPlugin→UniTask.CompletedTask.LightSourcePlugin.CreateLightSourcePoolAsync→ returnsUniTask.CompletedTask(body is fully synchronous).SceneAdminsChatCommand.ExecuteCommandAsyncandIRealmControllernull-objectIsReachableAsync→UniTask.FromResult(...).UnityLocalizationSceneTipsProvider.GetAsync→UniTask.FromResult(fallbackTips)(the real async body is currently commented out).VoiceChat/Microphone/MicrophoneTrackPublisher.CreateMicrophoneSourceAsync— the onlyawaitis behind#if UNITY_STANDALONE_OSX, so non-macOS builds legitimately have noawait; wrapped in a scoped#pragma warning disable/restore CS1998rather than adding a no-opawait.StreamableLoading/Tests/LoadSystemBaseOngoingRequestRaceShould.cs— the race test drives the system synchronously and never awaits; convertedasync Task→voidand dropped the now-unusedSystem.Threading.Tasksimport.No behavioral change is intended — every call site preserves its prior runtime semantics; the fixes only make intent explicit and remove the spurious async state machines.
Test Instructions
This is a pure correctness/warnings cleanup with no expected behavioral change — primarily a sanity check that nothing regressed.
Steps (standard run):
metaforge explorer run XXXX # ← replace with this PR numberExpected result:
/scene-adminschat command still returns the admin list.Test Steps
Quality Checklist