fix: harden engagement mutations (#53) (thanks @the-vampiire)

This commit is contained in:
Peter Steinberger
2026-06-24 18:44:38 +09:00
committed by yuta
parent 81f1229660
commit a167ac4380
5 changed files with 129 additions and 2 deletions
+3 -1
View File
@@ -28,7 +28,9 @@ export function withEngagement<TBase extends AbstractConstructor<TwitterClientBa
operationName: OperationName,
tweetId: string,
): Promise<BookmarkMutationResult> {
const variables = { tweet_id: tweetId };
await this.ensureClientUserId();
const variables =
operationName === 'DeleteRetweet' ? { tweet_id: tweetId, source_tweet_id: tweetId } : { tweet_id: tweetId };
let queryId = await this.getQueryId(operationName);
let urlWithOperation = `${TWITTER_API_BASE}/${queryId}/${operationName}`;