Skip to content

Commit cc57a7f

Browse files
committed
Remove bulk future-send request
as it is trickier to properly type / reuse code for, and is just an alternative proposal in MSC4140 anyways
1 parent 1db9635 commit cc57a7f

File tree

2 files changed

+0
-46
lines changed

2 files changed

+0
-46
lines changed

src/@types/requests.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,6 @@ export type ISendFutureResponse<F extends ISendFutureRequestOpts> = F extends IS
105105
? ISendTimeoutFutureResponse
106106
: ISendActionFutureResponse;
107107

108-
export interface ISendFutureGroupResponse {
109-
send_on_timeout: ITimeoutFutureTokens;
110-
send_on_action?: {
111-
[action_name: string]: IFutureTokens;
112-
};
113-
send_now?: ISendEventResponse;
114-
}
115-
116108
interface IFuturePartialEvent {
117109
room_id: string;
118110
type: string;

src/client.ts

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ import {
132132
IRoomDirectoryOptions,
133133
ISearchOpts,
134134
ISendEventResponse,
135-
ISendFutureGroupResponse,
136135
ISendFutureRequestOpts,
137136
ISendFutureResponse,
138137
IStatusResponse,
@@ -5364,43 +5363,6 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
53645363
});
53655364
}
53665365

5367-
/**
5368-
* Send a group of future events.
5369-
* TODO: type safety & threads...or remove altogether
5370-
*
5371-
* Note: This endpoint is unstable, and can throw an `Error`.
5372-
* Check progress on [MSC4140](https://github.com/matrix-org/matrix-spec-proposals/pull/4140) for more details.
5373-
*/
5374-
// eslint-disable-next-line
5375-
public async _unstable_sendFutureGroup(
5376-
roomId: string,
5377-
timeout: number,
5378-
sendOnTimeout: MatrixEvent,
5379-
sendOnAction?: Record<string, MatrixEvent>,
5380-
sendNow?: MatrixEvent,
5381-
): Promise<ISendFutureGroupResponse> {
5382-
if (!(await this.doesServerSupportUnstableFeature(UNSTABLE_MSC4140_FUTURES))) {
5383-
throw Error("Server does not support the Futures API");
5384-
}
5385-
5386-
return await this.http.authedRequest<ISendFutureGroupResponse>(
5387-
Method.Put,
5388-
// NOTE: Difference from MSC = remove /send part of path, to avoid ambiguity with regular event sending
5389-
utils.encodeUri("/rooms/$roomId/future/$txnId", {
5390-
$roomId: roomId,
5391-
$txnId: this.makeTxnId(),
5392-
}),
5393-
undefined,
5394-
{
5395-
timeout,
5396-
send_on_timeout: sendOnTimeout,
5397-
...(sendOnAction ?? { send_on_action: sendOnAction }),
5398-
...(sendNow ?? { send_now: sendNow }),
5399-
},
5400-
{ prefix: `${ClientPrefix.Unstable}/${UNSTABLE_MSC4140_FUTURES}` },
5401-
);
5402-
}
5403-
54045366
/**
54055367
* Get all pending futures for the calling user.
54065368
*

0 commit comments

Comments
 (0)