chore(deps): upgrade Expo SDK from 55 to 56
Some checks failed
Frontend CI / ota-android (push) Successful in 3m39s
Frontend CI / ota-ios (push) Successful in 3m40s
Frontend CI / build-and-push-web (push) Successful in 11m53s
Frontend CI / build-android-apk (push) Failing after 13m6s

Migrate from @react-navigation/native to expo-router navigation hooks across all screens.
Add polyfills module and apply LiveKit VideoView optional loading for Expo Go compatibility.
Improve background sync to skip when user is not logged in.
Enhance fetchUnreadCount to return typed totalUnread and systemUnread values.
This commit is contained in:
lafay
2026-06-01 22:56:37 +08:00
parent f39288f401
commit ad06881b85
21 changed files with 1893 additions and 2727 deletions

View File

@@ -208,7 +208,7 @@ class MessageManager {
return this.syncService.loadMoreMessages(conversationId, beforeSeq, limit);
}
async fetchUnreadCount(): Promise<void> {
async fetchUnreadCount(): Promise<{ totalUnread: number; systemUnread: number }> {
return this.syncService.fetchUnreadCount();
}

View File

@@ -30,7 +30,7 @@ export class MessageSyncService implements IMessageSyncService {
/** 正在加载会话列表下一页 */
private loadingMoreConversations = false;
/** fetchUnreadCount 去重:复用 in-flight promise */
private fetchUnreadCountPromise: Promise<void> | null = null;
private fetchUnreadCountPromise: Promise<{ totalUnread: number; systemUnread: number }> | null = null;
constructor(
getCurrentUserId: () => string | null,
@@ -352,19 +352,20 @@ export class MessageSyncService implements IMessageSyncService {
/**
* 获取未读数(去重:复用 in-flight promise
*/
async fetchUnreadCount(): Promise<void> {
async fetchUnreadCount(): Promise<{ totalUnread: number; systemUnread: number }> {
if (this.fetchUnreadCountPromise) {
return this.fetchUnreadCountPromise;
}
this.fetchUnreadCountPromise = this.doFetchUnreadCount();
try {
await this.fetchUnreadCountPromise;
const result = await this.fetchUnreadCountPromise;
return result;
} finally {
this.fetchUnreadCountPromise = null;
}
}
private async doFetchUnreadCount(): Promise<void> {
private async doFetchUnreadCount(): Promise<{ totalUnread: number; systemUnread: number }> {
const store = useMessageStore.getState();
try {
@@ -392,8 +393,10 @@ export class MessageSyncService implements IMessageSyncService {
// 服务端汇总未读为 0不主动清零本地未读等 fetchConversations 提供权威数据
// 避免后端缓存竞态导致的未读数抖动
return { totalUnread, systemUnread };
} catch (error) {
console.error('[MessageSyncService] 获取未读数失败:', error);
return { totalUnread: 0, systemUnread: 0 };
}
}