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
812
res.json({ success: true, message: 'Check triggered' });
813
813
});
814
814
815
815
+
app.post('/api/backfill/clear-all', authenticateToken, requireAdmin, (_req, res) => {
816
816
+
pendingBackfills = [];
817
817
+
updateAppStatus({
818
818
+
state: 'idle',
819
819
+
message: 'All backfills cleared',
820
820
+
backfillMappingId: undefined,
821
821
+
backfillRequestId: undefined,
822
822
+
});
823
823
+
res.json({ success: true, message: 'All backfills cleared' });
824
824
+
});
825
825
+
815
826
app.post('/api/backfill/:id', authenticateToken, requireAdmin, (req, res) => {
816
827
const { id } = req.params;
817
828
const { limit } = req.body;
···
848
859
const { id } = req.params;
849
860
pendingBackfills = pendingBackfills.filter((bid) => bid.id !== id);
850
861
res.json({ success: true });
851
851
-
});
852
852
-
853
853
-
app.post('/api/backfill/clear-all', authenticateToken, requireAdmin, (_req, res) => {
854
854
-
pendingBackfills = [];
855
855
-
updateAppStatus({
856
856
-
state: 'idle',
857
857
-
message: 'All backfills cleared',
858
858
-
backfillMappingId: undefined,
859
859
-
backfillRequestId: undefined,
860
860
-
});
861
861
-
res.json({ success: true, message: 'All backfills cleared' });
862
862
});
863
863
864
864
// --- Config Management Routes ---
+8
-9
web/src/App.tsx
···
240
240
const ADD_ACCOUNT_STEP_COUNT = 4;
241
241
const ADD_ACCOUNT_STEPS = ['Owner', 'Sources', 'Bluesky', 'Confirm'] as const;
242
242
const ACCOUNT_SEARCH_MIN_SCORE = 22;
243
243
+
const DEFAULT_BACKFILL_LIMIT = 15;
243
244
244
245
const selectClassName =
245
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';
···
1378
1379
return;
1379
1380
}
1380
1381
}
1381
1381
-
1382
1382
-
const limitInput = window.prompt(`How many tweets should be backfilled for this account?`, '15');
1383
1383
-
if (limitInput === null) {
1384
1384
-
return;
1385
1385
-
}
1386
1386
-
1387
1387
-
const limit = Number.parseInt(limitInput, 10);
1388
1388
-
const safeLimit = Number.isFinite(limit) && limit > 0 ? limit : 15;
1382
1382
+
const safeLimit = DEFAULT_BACKFILL_LIMIT;
1389
1383
1390
1384
try {
1391
1385
if (mode === 'reset') {
···
1393
1387
}
1394
1388
1395
1389
await axios.post(`/api/backfill/${mappingId}`, { limit: safeLimit }, { headers: authHeaders });
1396
1396
-
showNotice('success', mode === 'reset' ? 'Cache reset and backfill queued.' : 'Backfill queued.');
1390
1390
+
showNotice(
1391
1391
+
'success',
1392
1392
+
mode === 'reset'
1393
1393
+
? `Cache reset and backfill queued (${safeLimit} tweets).`
1394
1394
+
: `Backfill queued (${safeLimit} tweets).`,
1395
1395
+
);
1397
1396
await fetchStatus();
1398
1397
} catch (error) {
1399
1398
handleAuthFailure(error, 'Failed to queue backfill.');