Skip to content

Commit e84b7ac

Browse files
committed
reduce amount of failing tests
1 parent 093d7cc commit e84b7ac

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

spec/integ/matrix-client-event-timeline.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,8 @@ describe("MatrixClient event timelines", function() {
342342
httpBackend.verifyNoOutstandingExpectation();
343343
client.stopClient();
344344
Thread.setServerSideSupport(FeatureSupport.None);
345+
Thread.setServerSideListSupport(FeatureSupport.None);
346+
Thread.setServerSideFwdPaginationSupport(FeatureSupport.None);
345347
});
346348

347349
describe("getEventTimeline", function() {

spec/integ/matrix-client-relations.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ describe("MatrixClient relations", () => {
6060

6161
await httpBackend!.flushAllExpected();
6262

63-
expect(await response).toEqual({ "events": [], "nextBatch": "NEXT" });
63+
expect(await response).toEqual({ "events": [], "nextBatch": "NEXT", "originalEvent": null, "prevBatch": null });
6464
});
6565

6666
it("should read related events with relation type", async () => {
@@ -72,7 +72,7 @@ describe("MatrixClient relations", () => {
7272

7373
await httpBackend!.flushAllExpected();
7474

75-
expect(await response).toEqual({ "events": [], "nextBatch": "NEXT" });
75+
expect(await response).toEqual({ "events": [], "nextBatch": "NEXT", "originalEvent": null, "prevBatch": null });
7676
});
7777

7878
it("should read related events with relation type and event type", async () => {
@@ -87,7 +87,7 @@ describe("MatrixClient relations", () => {
8787

8888
await httpBackend!.flushAllExpected();
8989

90-
expect(await response).toEqual({ "events": [], "nextBatch": "NEXT" });
90+
expect(await response).toEqual({ "events": [], "nextBatch": "NEXT", "originalEvent": null, "prevBatch": null });
9191
});
9292

9393
it("should read related events with custom options", async () => {
@@ -107,7 +107,7 @@ describe("MatrixClient relations", () => {
107107

108108
await httpBackend!.flushAllExpected();
109109

110-
expect(await response).toEqual({ "events": [], "nextBatch": "NEXT" });
110+
expect(await response).toEqual({ "events": [], "nextBatch": "NEXT", "originalEvent": null, "prevBatch": null });
111111
});
112112

113113
it('should use default direction in the fetchRelations endpoint', async () => {
@@ -122,6 +122,6 @@ describe("MatrixClient relations", () => {
122122

123123
await httpBackend!.flushAllExpected();
124124

125-
expect(await response).toEqual({ "chunk": [], "next_batch": "NEXT" });
125+
expect(await response).toEqual({ "chunk": [], "next_batch": "NEXT", "originalEvent": null, "prevBatch": null });
126126
});
127127
});

src/client.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5196,6 +5196,10 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
51965196

51975197
const mapper = this.getEventMapper();
51985198
const event = mapper(res.event);
5199+
if (event.isRelation(THREAD_RELATION_TYPE.name)) {
5200+
logger.warn("Tried loading a regular timeline at the position of a thread event");
5201+
return undefined;
5202+
}
51995203
const events = [
52005204
// Order events from most recent to oldest (reverse-chronological).
52015205
// We start with the last event, since that's the point at which we have known state.
@@ -6957,8 +6961,8 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
69576961
return {
69586962
originalEvent: originalEvent ?? null,
69596963
events,
6960-
nextBatch: result.next_batch,
6961-
prevBatch: result.prev_batch,
6964+
nextBatch: result.next_batch ?? null,
6965+
prevBatch: result.prev_batch ?? null,
69626966
};
69636967
}
69646968

0 commit comments

Comments
 (0)