Remove unspecced original_event field from the readEventRelations response (#9349)

Signed-off-by: Dominik Henneke <dominik.henneke@nordeck.net>

Signed-off-by: Dominik Henneke <dominik.henneke@nordeck.net>
This commit is contained in:
Dominik Henneke 2022-10-04 19:54:26 +02:00 committed by GitHub
parent 16c3efead5
commit 99488b84ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 23 deletions

View file

@ -434,7 +434,6 @@ export class StopGapWidgetDriver extends WidgetDriver {
}
const {
originalEvent,
events,
nextBatch,
prevBatch,
@ -451,7 +450,6 @@ export class StopGapWidgetDriver extends WidgetDriver {
});
return {
originalEvent: originalEvent?.getEffectiveEvent(),
chunk: events.map(e => e.getEffectiveEvent()),
nextBatch,
prevBatch,

View file

@ -209,7 +209,6 @@ describe("StopGapWidgetDriver", () => {
});
await expect(driver.readEventRelations('$event')).resolves.toEqual({
originalEvent: expect.objectContaining({ content: {} }),
chunk: [],
nextBatch: undefined,
prevBatch: undefined,
@ -218,24 +217,6 @@ describe("StopGapWidgetDriver", () => {
expect(client.relations).toBeCalledWith('!this-room-id', '$event', null, null, {});
});
it('reads related events if the original event is missing', async () => {
client.relations.mockResolvedValue({
// the relations function can return an undefined event, even
// though the typings don't permit an undefined value.
originalEvent: undefined as any,
events: [],
});
await expect(driver.readEventRelations('$event', '!room-id')).resolves.toEqual({
originalEvent: undefined,
chunk: [],
nextBatch: undefined,
prevBatch: undefined,
});
expect(client.relations).toBeCalledWith('!room-id', '$event', null, null, {});
});
it('reads related events from a selected room', async () => {
client.relations.mockResolvedValue({
originalEvent: new MatrixEvent(),
@ -244,7 +225,6 @@ describe("StopGapWidgetDriver", () => {
});
await expect(driver.readEventRelations('$event', '!room-id')).resolves.toEqual({
originalEvent: expect.objectContaining({ content: {} }),
chunk: [
expect.objectContaining({ content: {} }),
expect.objectContaining({ content: {} }),
@ -272,7 +252,6 @@ describe("StopGapWidgetDriver", () => {
25,
'f',
)).resolves.toEqual({
originalEvent: expect.objectContaining({ content: {} }),
chunk: [],
nextBatch: undefined,
prevBatch: undefined,