tangled
alpha
login
or
join now
indexx.dev
/
tweets2bsky
forked from
j4ck.xyz/tweets2bsky
0
fork
atom
A simple tool which lets you scrape twitter accounts and crosspost them to bluesky accounts! Comes with a CLI and a webapp for managing profiles! Works with images/videos/link embeds/threads.
0
fork
atom
overview
issues
pulls
pipelines
fix: restore backfill actions after clear queue
jack
3 weeks ago
e973127b
f349fd21
+19
-20
2 changed files
expand all
collapse all
unified
split
src
server.ts
web
src
App.tsx
+11
-11
src/server.ts
···
812
res.json({ success: true, message: 'Check triggered' });
813
});
814
0
0
0
0
0
0
0
0
0
0
0
815
app.post('/api/backfill/:id', authenticateToken, requireAdmin, (req, res) => {
816
const { id } = req.params;
817
const { limit } = req.body;
···
848
const { id } = req.params;
849
pendingBackfills = pendingBackfills.filter((bid) => bid.id !== id);
850
res.json({ success: true });
851
-
});
852
-
853
-
app.post('/api/backfill/clear-all', authenticateToken, requireAdmin, (_req, res) => {
854
-
pendingBackfills = [];
855
-
updateAppStatus({
856
-
state: 'idle',
857
-
message: 'All backfills cleared',
858
-
backfillMappingId: undefined,
859
-
backfillRequestId: undefined,
860
-
});
861
-
res.json({ success: true, message: 'All backfills cleared' });
862
});
863
864
// --- Config Management Routes ---
···
812
res.json({ success: true, message: 'Check triggered' });
813
});
814
815
+
app.post('/api/backfill/clear-all', authenticateToken, requireAdmin, (_req, res) => {
816
+
pendingBackfills = [];
817
+
updateAppStatus({
818
+
state: 'idle',
819
+
message: 'All backfills cleared',
820
+
backfillMappingId: undefined,
821
+
backfillRequestId: undefined,
822
+
});
823
+
res.json({ success: true, message: 'All backfills cleared' });
824
+
});
825
+
826
app.post('/api/backfill/:id', authenticateToken, requireAdmin, (req, res) => {
827
const { id } = req.params;
828
const { limit } = req.body;
···
859
const { id } = req.params;
860
pendingBackfills = pendingBackfills.filter((bid) => bid.id !== id);
861
res.json({ success: true });
0
0
0
0
0
0
0
0
0
0
0
862
});
863
864
// --- Config Management Routes ---
+8
-9
web/src/App.tsx
···
240
const ADD_ACCOUNT_STEP_COUNT = 4;
241
const ADD_ACCOUNT_STEPS = ['Owner', 'Sources', 'Bluesky', 'Confirm'] as const;
242
const ACCOUNT_SEARCH_MIN_SCORE = 22;
0
243
244
const selectClassName =
245
'flex h-10 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2';
···
1378
return;
1379
}
1380
}
1381
-
1382
-
const limitInput = window.prompt(`How many tweets should be backfilled for this account?`, '15');
1383
-
if (limitInput === null) {
1384
-
return;
1385
-
}
1386
-
1387
-
const limit = Number.parseInt(limitInput, 10);
1388
-
const safeLimit = Number.isFinite(limit) && limit > 0 ? limit : 15;
1389
1390
try {
1391
if (mode === 'reset') {
···
1393
}
1394
1395
await axios.post(`/api/backfill/${mappingId}`, { limit: safeLimit }, { headers: authHeaders });
1396
-
showNotice('success', mode === 'reset' ? 'Cache reset and backfill queued.' : 'Backfill queued.');
0
0
0
0
0
1397
await fetchStatus();
1398
} catch (error) {
1399
handleAuthFailure(error, 'Failed to queue backfill.');
···
240
const ADD_ACCOUNT_STEP_COUNT = 4;
241
const ADD_ACCOUNT_STEPS = ['Owner', 'Sources', 'Bluesky', 'Confirm'] as const;
242
const ACCOUNT_SEARCH_MIN_SCORE = 22;
243
+
const DEFAULT_BACKFILL_LIMIT = 15;
244
245
const selectClassName =
246
'flex h-10 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2';
···
1379
return;
1380
}
1381
}
1382
+
const safeLimit = DEFAULT_BACKFILL_LIMIT;
0
0
0
0
0
0
0
1383
1384
try {
1385
if (mode === 'reset') {
···
1387
}
1388
1389
await axios.post(`/api/backfill/${mappingId}`, { limit: safeLimit }, { headers: authHeaders });
1390
+
showNotice(
1391
+
'success',
1392
+
mode === 'reset'
1393
+
? `Cache reset and backfill queued (${safeLimit} tweets).`
1394
+
: `Backfill queued (${safeLimit} tweets).`,
1395
+
);
1396
await fetchStatus();
1397
} catch (error) {
1398
handleAuthFailure(error, 'Failed to queue backfill.');