···
3
3
import { containsBannedWords, sanitizeText } from '@/lib/content-filter';
4
4
5
5
// Configure this route as dynamic to prevent any caching
6
6
+
// Make sure this route is not cached
6
7
export const dynamic = 'force-dynamic';
8
8
+
export const fetchCache = 'force-no-store';
7
9
8
10
// Define type for our database entry
9
11
interface FlushingRecord {
···
44
46
try {
45
47
const url = new URL(request.url);
46
48
const beforeCursor = url.searchParams.get('before');
49
49
+
const refresh = url.searchParams.get('refresh') === 'true';
47
50
48
48
-
console.log(`Request params: beforeCursor=${beforeCursor || 'none'}`);
51
51
+
console.log(`Request params: beforeCursor=${beforeCursor || 'none'}, refresh=${refresh}`);
52
52
+
53
53
+
// If refreshing, log it clearly
54
54
+
if (refresh) {
55
55
+
console.log('🔄 REFRESH requested - ensuring fresh data');
56
56
+
}
49
57
50
58
// If we don't have Supabase credentials, return an error
51
59
if (!supabaseUrl || !supabaseKey) {
···
183
183
uri: result.uri,
184
184
cid: result.cid,
185
185
authorDid: did,
186
186
-
authorHandle: handle,
186
186
+
authorHandle: handle || 'unknown',
187
187
text: formattedText,
188
188
emoji: selectedEmoji,
189
189
createdAt: new Date().toISOString()
···
225
225
const timestamp = Date.now();
226
226
227
227
// Use our simple API endpoint for reliability
228
228
-
const url = `/api/bluesky/feed-simple?_t=${timestamp}`;
228
228
+
// Add refresh=true when forcing a refresh to ensure we get fresh data
229
229
+
const url = forceRefresh
230
230
+
? `/api/bluesky/feed-simple?refresh=true&_t=${timestamp}`
231
231
+
: `/api/bluesky/feed-simple?_t=${timestamp}`;
229
232
230
233
console.log(`Fetching feed from ${url} at ${new Date().toISOString()}`);
231
234
···
485
488
setLoading(true);
486
489
setError(null);
487
490
488
488
-
// Use the simple API endpoint with a timestamp
491
491
+
// Use the simple API endpoint with a refresh parameter and timestamp
489
492
const timestamp = Date.now();
490
490
-
const url = `/api/bluesky/feed-simple?_t=${timestamp}`;
493
493
+
const url = `/api/bluesky/feed-simple?refresh=true&_t=${timestamp}`;
491
494
console.log(`🔄 MANUAL REFRESH @ ${new Date().toISOString()}`);
492
495
console.log(`Using simple API URL: ${url}`);
493
496