Skip to content

Commit 69845a4

Browse files
authored
fix: thread messages breaking pagination (#3422)
## 🎯 Goal This PR fixes an issue where in some instances sending a message within a thread (with lower `message_limit`) would break pagination for the offline support case ## πŸ›  Implementation details <!-- Provide a description of the implementation --> ## 🎨 UI Changes <!-- Add relevant screenshots --> <details> <summary>iOS</summary> <table> <thead> <tr> <td>Before</td> <td>After</td> </tr> </thead> <tbody> <tr> <td> <!--<img src="" /> --> </td> <td> <!--<img src="" /> --> </td> </tr> </tbody> </table> </details> <details> <summary>Android</summary> <table> <thead> <tr> <td>Before</td> <td>After</td> </tr> </thead> <tbody> <tr> <td> <!--<img src="" /> --> </td> <td> <!--<img src="" /> --> </td> </tr> </tbody> </table> </details> ## πŸ§ͺ Testing <!-- Explain how this change can be tested (or why it can't be tested) --> ## β˜‘οΈ Checklist - [ ] I have signed the [Stream CLA](https://docs.google.com/forms/d/e/1FAIpQLScFKsKkAJI7mhCr7K9rEIOpqIDThrWxuvxnwUq2XkHyG154vQ/viewform) (required) - [ ] PR targets the `develop` branch - [ ] Documentation is updated - [ ] New code is tested in main example apps, including all possible scenarios - [ ] SampleApp iOS and Android - [ ] Expo iOS and Android
1 parent 7ce9bc9 commit 69845a4

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

β€Žpackage/src/store/SqliteClient.tsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import type { PreparedBatchQueries, PreparedQueries, Scalar, Table } from './typ
2828
* This way usage @op-engineering/op-sqlite package is scoped to a single class/file.
2929
*/
3030
export class SqliteClient {
31-
static dbVersion = 14;
31+
static dbVersion = 15;
3232

3333
static dbName = DB_NAME;
3434
static dbLocation = DB_LOCATION;

β€Žpackage/src/store/apis/upsertMessages.tsβ€Ž

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ export const upsertMessages = async ({
2424
const storableLocations: Array<ReturnType<typeof mapSharedLocationToStorable>> = [];
2525

2626
messages?.forEach((message: MessageResponse | LocalMessage) => {
27+
if (message.parent_id && !message.show_in_channel) {
28+
return;
29+
}
2730
storableMessages.push(mapMessageToStorable(message));
2831
if (message.user) {
2932
storableUsers.push(mapUserToStorable(message.user));

0 commit comments

Comments
Β (0)