bug: useSubscriptions re-queries WatermelonDB on every server connection state change, causing unnecessary rooms list flicker
Maintainer thường phản hồi trong vòng 1 ngày
@deepak0x đang làm issue này rồi.
Từ ngày 3/4/2026.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 82/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- react-native, typescript
- Lĩnh vực
- mobile
Hướng nghiên cứu
Bắt đầu với app/views/RoomsListView/hooks/useSubscriptions.ts và kiểm tra danh sách dependency của useEffect cũng như trạng thái server được chọn ở đó. Tái hiện vấn đề bằng cách chuyển đổi trạng thái mạng hoặc kết nối, sau đó xác minh rằng subscription của WatermelonDB chỉ được tạo lại khi URL server thay đổi và các chuyển tiếp kết nối không còn làm danh sách phòng bị trống hoặc nhấp nháy.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
app/views/RoomsListView/hooks/useSubscriptions.ts selects the entire server Redux object as a useEffect dependency:
const server = useAppSelector(state => state.server);
}, [isGrouping, sortBy, useRealName, showUnread, showFavorites, groupByType, roles, server]);
Since Redux reducers return a new object reference on every dispatch (even when only connecting or loading fields change), the useEffect fires on every server connection lifecycle transition — not just when the actual server URL changes.
Each spurious fire:
- Calls
setLoading(true)— rooms list blanks out - Unsubscribes the existing WatermelonDB observable
- Creates and subscribes a brand new observable
Steps to Reproduce
- Open the app on a slow or unstable network
- Watch the rooms list — it briefly flickers/shows a loading spinner multiple times even after rooms have already loaded
- Or: toggle airplane mode off → observe rooms list reload multiple times in quick succession
Expected Behavior
The WatermelonDB subscription should only be recreated when the server URL actually changes (i.e. user switches servers). Connection state transitions like connecting: true → false or loading: true → false should not cause the rooms list to re-query.
Actual Behavior
The useEffect fires 4 times during a single reconnection cycle, even though the server URL never changes. Each fire triggers a full WatermelonDB resubscribe and a setLoading(true) flash.
Rocket.Chat Server Version
Not applicable — this is a client-side bug
Rocket.Chat App Version
Latest main branch
Device Name
Any
OS Version
Any (iOS and Android)
- Ngôn ngữ chính
- TypeScript
- Star
- 2.4k
- Fork
- 1.5k
- Merge trung bình
- 1 ngày 15 giờ
- Pull request đã merge (30 ngày)
- 29
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của RocketChat/Rocket.Chat.ReactNative
-
[IMPROVEMENT] Remove redundant `await` on synchronous `userPreferences.getBool` in `getUsersPresence`Có thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởtype: feature
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
RocketChat/Rocket.Chat.ReactNative#7737 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
UIKit modal: a viewSubmit response with no `type` field fails to close the modal on mobile (regression from #7057)Có thể đã có người làm @erikurt9 đã nhận 106 ngày trước. Đang mởtype: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
RocketChat/Rocket.Chat.ReactNative#7503 · 3 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
type: bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
RocketChat/Rocket.Chat.ReactNative#7437 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
✅ tests 👷 ci type: feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
RocketChat/Rocket.Chat.ReactNative#7247 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug: goRoom navigates to broken RoomView after failed DM creation from searchCó thể đã có người làm @deepak0x đã nhận 216 ngày trước. Đang mởtype: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
RocketChat/Rocket.Chat.ReactNative#7098 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của RocketChat/Rocket.Chat.ReactNative
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
langchain-ai/langchainjs#12239 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Board view: the Monitoring column is always empty because compact issue rows drop displayStatusĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
paperclipai/paperclip#21837 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
code-yeongyu/senpi#6813 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 93/100
lingdojo/kana-dojo#34169 · 1 bình luận · 5 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100