Nima1 reported a bug with the Discourse Chat plugin’s API, where the page_size parameter is ignored when querying past chat messages in channels with threading enabled. The issue occurs when using the endpoint /chat/api/channels/{channel_id}/threads/{thread_id}/messages with the direction=past parameter, causing the API to return the maximum number of messages (50) instead of the requested page_size. sam initially thought the behavior might be deliberate, but loic was unable to replicate the issue initially. Nima1 clarified that the problem only occurs in channels with threading enabled. loic later found and fixed the bug, including the fix in a pull request (#33380).
ניסיתי לשחזר את זה במשך זמן מה, אך לא הצלחתי לעשות זאת.
בדקתי את Chat::MessagesQuery, Chat::ListChannelMessages ואת פעולת הבקר דרך המפרטים שלנו וגם באופן ידני על מופע מקומי. הפרמטר page_size נלקח בחשבון כמצופה, כמו גם הפרמטר direction.
@Nima1 האם אתה בטוח שאתה משתמש בנקודת הקצה הנכונה? היא צריכה להכיל api בתוכה, כך: /chat/api/channels/3/messages?target_message_id=40&direction=past&page_size=5.
דבר נוסף שלא בדקתי הוא אם ההתנהגות שונה ב-stable. האם המופע שלך מעודכן עם הענף tests-passed?