mirror of
https://github.com/dergigi/boris.git
synced 2025-12-20 16:14:20 +01:00
fix: improve offline sync with better tracking and logging
- Track events explicitly when created in offline mode - Mark highlights as offline-created when isLocalOnly is true - Add extensive debug logging throughout sync process - Increase query timeout from 5s to 10s for better reliability - Add 2-second delay before syncing to allow relays to connect - Log relay state transitions and event counts - Log each event received during sync query - Should help diagnose and fix offline sync issues
This commit is contained in:
@@ -8,6 +8,7 @@ import { RELAYS } from '../config/relays'
|
||||
import { Highlight } from '../types/highlights'
|
||||
import { UserSettings } from './settingsService'
|
||||
import { areAllRelaysLocal } from '../utils/helpers'
|
||||
import { markEventAsOfflineCreated } from './offlineSyncService'
|
||||
|
||||
// Boris pubkey for zap splits
|
||||
const BORIS_PUBKEY = '6e468422dfb74a5738702a8823b9b28168fc6cfb119d613e49ca0ec5a0bbd0c3'
|
||||
@@ -142,6 +143,11 @@ export async function createHighlight(
|
||||
eventId: signedEvent.id
|
||||
})
|
||||
|
||||
// If we're in local-only mode, mark this event for later sync
|
||||
if (isLocalOnly) {
|
||||
markEventAsOfflineCreated(signedEvent.id)
|
||||
}
|
||||
|
||||
// Convert to Highlight with relay tracking info
|
||||
const highlight = eventToHighlight(signedEvent)
|
||||
highlight.publishedRelays = actualPublishedRelays
|
||||
|
||||
Reference in New Issue
Block a user