fix: force fresh sweetistics thread fetch

This commit is contained in:
Peter Steinberger
2025-12-05 23:39:06 +01:00
parent c9d7646138
commit f2855643f3
2 changed files with 11 additions and 2 deletions
+7 -2
View File
@@ -380,10 +380,15 @@ export class SweetisticsClient {
private async fetchConversation(
tweetId: string,
options: { excludeRoot: boolean },
options: { excludeRoot: boolean; force?: boolean } = { excludeRoot: false, force: true },
): Promise<SweetisticsTimelineResult> {
const url = new URL(`${this.baseUrl}/api/trpc/tweets.getConversation`);
url.searchParams.set('input', JSON.stringify({ tweetId }));
const input: Record<string, unknown> = { tweetId };
// Always request a fresh conversation to avoid cached Sweetistics data unless explicitly disabled
if (options.force ?? true) {
input.force = 'true';
}
url.searchParams.set('input', JSON.stringify(input));
let response: Response;
try {