diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index aaf453e..7c9385d 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -524,7 +524,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/RunnerRelease.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 150; + CURRENT_PROJECT_VERSION = 160; DEVELOPMENT_TEAM = S9YG87C297; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; @@ -533,7 +533,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.5.0; + MARKETING_VERSION = 1.6.0; PRODUCT_BUNDLE_IDENTIFIER = com.org.yumiparty; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -715,7 +715,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/RunnerDebug.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 150; + CURRENT_PROJECT_VERSION = 160; DEVELOPMENT_TEAM = S9YG87C297; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; @@ -724,7 +724,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.5.0; + MARKETING_VERSION = 1.6.0; PRODUCT_BUNDLE_IDENTIFIER = com.org.yumiparty; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -744,7 +744,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/RunnerRelease.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 150; + CURRENT_PROJECT_VERSION = 160; DEVELOPMENT_TEAM = S9YG87C297; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; @@ -753,7 +753,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.5.0; + MARKETING_VERSION = 1.6.0; PRODUCT_BUNDLE_IDENTIFIER = com.org.yumiparty; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/lib/services/audio/rtc_manager.dart b/lib/services/audio/rtc_manager.dart index d2415c7..3e341d8 100644 --- a/lib/services/audio/rtc_manager.dart +++ b/lib/services/audio/rtc_manager.dart @@ -5308,8 +5308,8 @@ class RealTimeCommunicationManager extends ChangeNotifier { return localUser.copyWith(roles: currenRoom?.entrants?.roles); } return localUser.copyWith( - id: _firstNonBlankText([localUser.id, responseUser.id]), - account: _firstNonBlankText([localUser.account, responseUser.account]), + id: _firstNonBlankText([responseUser.id, localUser.id]), + account: _firstNonBlankText([responseUser.account, localUser.account]), userAvatar: _firstNonBlankText([ localUser.userAvatar, responseUser.userAvatar, diff --git a/pubspec.yaml b/pubspec.yaml index a584edd..98fee40 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 1.5.0+150 +version: 1.6.0+160 environment: diff --git a/test/rtc_self_mic_snapshot_test.dart b/test/rtc_self_mic_snapshot_test.dart index e49f2d2..92b8563 100644 --- a/test/rtc_self_mic_snapshot_test.dart +++ b/test/rtc_self_mic_snapshot_test.dart @@ -83,4 +83,38 @@ void main() { expect(rtcProvider.roomWheatMap[4]?.user?.id, 'user-android'); expect(rtcProvider.roomWheatMap[4]?.user?.account, 'android-account'); }); + + test('self go-up prefers response identity over stale local profile', () { + SharedPreferences.setMockInitialValues({}); + AccountStorage().setCurrentUser( + SocialChatLoginRes( + userProfile: SocialChatUserProfile( + id: 'stale-local-id', + account: 'stale-local-account', + userNickname: 'Me', + ), + ), + ); + final rtcProvider = + RealTimeCommunicationManager()..roomWheatMap = {5: MicRes(micIndex: 5)}; + + rtcProvider.debugApplySelfMicGoUpResponse( + localUser: AccountStorage().getCurrentUser()?.userProfile, + targetIndex: 5, + micGoUpRes: mic_go_up.SCMicGoUpRes( + micIndex: 5, + micMute: false, + user: mic_go_up.User( + id: 'server-seat-id', + account: 'server-seat-account', + userNickname: 'Server User', + ), + ), + ); + + expect(rtcProvider.isOnMai(), isTrue); + expect(rtcProvider.isOnMaiInIndex(5), isTrue); + expect(rtcProvider.roomWheatMap[5]?.user?.id, 'server-seat-id'); + expect(rtcProvider.roomWheatMap[5]?.user?.account, 'server-seat-account'); + }); }