You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
XCTAssertNotNil(authSession.sceneId, @"sceneId must be non-nil so the advanced-auth callback options dictionary is safe to build and the session is stored under a valid key");
118
+
XCTAssertTrue([authSession.sceneId hasPrefix:kExpectedUnscopedSceneIdPrefix], @"A scene-less session should get the synthesized unscoped scene id, got: %@", authSession.sceneId);
119
+
}
120
+
121
+
// Two scene-less sessions must get distinct sceneIds so they cannot collide on a single authSessions[]
122
+
// key, and each sceneId must be stable for the session's lifetime.
XCTAssertNotEqualObjects(session1.sceneId, session2.sceneId, @"Two scene-less sessions must get distinct scene ids so they cannot collide on a single authSessions[] key");
140
+
// Frozen for the session's lifetime: reading again yields the same value.
141
+
XCTAssertEqualObjects(session1.sceneId, session1.sceneId, @"sceneId must be stable for the session's lifetime");
142
+
}
143
+
144
+
// Helper to build a coordinator whose browser-callback options we can inspect.
XCTAssertEqualObjects(options[kSFIDPSceneIdKey], @"scene-42", @"A non-nil sceneId must be carried under kSFIDPSceneIdKey so the callback routes to the originating scene");
162
+
XCTAssertEqual(options.count, (NSUInteger)1, @"Only the scene id key should be present");
163
+
}
164
+
165
+
// When no scene id is available (e.g. login started before a UIScene connected, or the weak
166
+
// authSession deallocated before the callback), the options must be an empty dictionary rather than
167
+
// crashing on a nil insert; the URL handler then falls back to the default scene.
XCTAssertNotNil(options, @"Options must never be nil");
174
+
XCTAssertEqual(options.count, (NSUInteger)0, @"A nil sceneId must yield an empty options dictionary so nil is never inserted and the handler falls back to the default scene");
0 commit comments