bug: jumping to an old thread reply or the thread parent silently fails in threads with 300+ replies
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 30/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- react-native, typescript
Hướng nghiên cứu
Start in app/views/RoomView/List/hooks/useScroll.ts, where onReObserve polls fetchMessages() up to MAX_JUMP_GROWTH_RETRIES and growsWindowTowardTarget decides when it runs, then read useMessages for the window count and app/lib/methods/loadThreadMessages.ts for loadThreadMessagesUntil. Done means a jump to the earliest reply or the thread parent in a 500+ reply thread scrolls to and highlights the target, while existing jumps keep working. The work depends on the unmerged #7773, so check its state before starting.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the Bug
In a thread with roughly 300 or more replies, jumping to an old reply (quote link, search result, deep link) or to the thread parent does nothing. The loading overlay closes after about 5 seconds, the list does not move, and no error is shown.
This was found while reviewing #7773, which loads threads 50 replies at a time on servers >= 8.8.0. It is listed under "Known limits" in that PR and was raised in this review comment, where the reviewer suggested handling it as a follow-up.
Why it happens
A jump inside a thread has two stages:
- Storing the target.
loadThreadMessagesUntil(app/lib/methods/loadThreadMessages.ts) pages the thread until the target is stored inthread_messages. This works at any depth. - Showing it. The list only renders what its Message Window holds, so after the target is stored the window still has to grow until it contains the target.
useScroll(app/views/RoomView/List/hooks/useScroll.ts) does this by polling inonReObserve: each time the target is not in the list it callsfetchMessages(), which grows the window byQUERY_SIZE(50), and waits for the next emit.
That polling is capped by MAX_JUMP_GROWTH_RETRIES = 5, and each growth step re-arms JUMP_SAFETY_TIMEOUT (5 s). The window therefore reaches about 300 rows (50 initial + 5 x 50). A target deeper than that never appears, the safety timeout fires, and abortJump resolves the jump without a scroll or an error.
The same distance problem exists one layer down: MAX_SCROLL_TO_INDEX_RETRIES was raised from 20 to 60 in #7773 so deep targets can be reached by scrollToIndex.
On develop this growth only applied to the main room's Anchored Window (jump.anchored). #7773 extended it to threads (|| !!tmid) so jumps inside a thread can reach replies outside the first window, and the same cap now limits them. #7773 also stops appending the thread parent below the newest 50 replies, so a jump to the parent now needs the window to reach the oldest reply. Per #7773's notes the limit applies on any server version.
Steps to Reproduce
- Use a server >= 8.8.0 and create a thread with about 500 replies.
- Open the thread in the app.
- Jump to one of the earliest replies (link to the reply from inside the thread, a search result, or a deep link). A link to the thread parent behaves the same way.
- All pages are requested (
offset0, 50, ... up to the page holding the target) and the window grows to about 300 rows.
Expected Behavior
The list scrolls to the target and highlights it.
Actual Behavior
After about 5 seconds the overlay closes with no scroll and no error.
Proposed approach
The target's ts is known once loadThreadMessagesUntil has stored it, so the window can be sized in one step instead of polled:
- Add a
growWindowTo(ts)touseMessages. It setscount.currentto the number of rows withts >= targetTsplusQUERY_SIZE, then re-subscribes once.raiseOrReleaseAnchoralready does the same kind of sizing with itsaboveCountquery (fetchCount()). - That would remove
growsWindowTowardTargetand thetmidparameter ofuseScroll, and may let the scroll-to-index retry cap go back to 20.
Things to check when picking this up:
- The count must use the same filters as the window query (
rid = tmid,buildVisibleSystemTypesClause(hideSystemMessages)), otherwise the window is sized too small or too large. Over-counting only adds harmless margin; under-counting reproduces the bug. growsWindowTowardTargetisjump.anchored || !!tmid, so the main room's Anchored Window jumps use the same polling. Decide whether that path keeps it or moves to the same approach.- A window of several hundred rows has a render and re-emit cost. Worth measuring on a low-end Android device with a 500+ reply thread.
- Related and separate: on a slow connection the 5 s highlight (
HIGHLIGHT_TIMEOUT) can expire before a deep jump arrives. Also listed in #7773's known limits.
Acceptance
- In a thread of 500+ replies, jumping to the earliest reply and to the thread parent scrolls to and highlights the target on servers >= 8.8.0 and on servers below it.
- Jumps within the first 300 rows and Anchored Window jumps in the main room behave as before.
- Unit tests cover the window sizing, and the termination test for the scroll-to-index retries still passes.
Rocket.Chat Server Version
= 8.8.0 (paged thread loading). The window-growth limit itself is server-version independent.
Rocket.Chat App Version
Needs #7773 (not yet merged at the time of writing).
- 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