diff --git a/package.json b/package.json index bfc43b3..dd3b1ba 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jumble-imwald", - "version": "12", + "version": "12.1", "description": "A user-friendly Nostr client focused on relay feed browsing and relay discovery, forked from Jumble", "private": true, "type": "module", diff --git a/src/components/Note/index.tsx b/src/components/Note/index.tsx index cfe1e6a..f6d816d 100644 --- a/src/components/Note/index.tsx +++ b/src/components/Note/index.tsx @@ -75,7 +75,8 @@ export default function Note({ ExtendedKind.GROUP_METADATA, ExtendedKind.PUBLIC_MESSAGE, ExtendedKind.ZAP_REQUEST, - ExtendedKind.ZAP_RECEIPT + ExtendedKind.ZAP_RECEIPT, + ExtendedKind.PUBLICATION_CONTENT // Only for rendering embedded content, not in feeds ] diff --git a/src/components/Profile/ProfileArticles.tsx b/src/components/Profile/ProfileArticles.tsx index 590e0ee..32a7d79 100644 --- a/src/components/Profile/ProfileArticles.tsx +++ b/src/components/Profile/ProfileArticles.tsx @@ -17,7 +17,6 @@ interface ProfileArticlesProps { } const ProfileArticles = forwardRef<{ refresh: () => void; getEvents: () => Event[] }, ProfileArticlesProps>(({ pubkey, topSpace, searchQuery = '', kindFilter = 'all', onEventsChange }, ref) => { - console.log('[ProfileArticles] Component rendered with pubkey:', pubkey) const [events, setEvents] = useState([]) const [isLoading, setIsLoading] = useState(true) const [retryCount, setRetryCount] = useState(0) @@ -47,14 +46,8 @@ const ProfileArticles = forwardRef<{ refresh: () => void; getEvents: () => Event const uniqueRelays = Array.from(new Set(normalizedRelays)) - console.log('[ProfileArticles] Comprehensive relay list:', uniqueRelays.length, 'relays') - console.log('[ProfileArticles] User relays (read):', userRelayList.read?.length || 0) - console.log('[ProfileArticles] User relays (write):', userRelayList.write?.length || 0) - console.log('[ProfileArticles] Favorite relays:', favoriteRelays?.length || 0) - return uniqueRelays } catch (error) { - console.warn('[ProfileArticles] Error building relay list, using fallback:', error) return FAST_READ_RELAY_URLS } }, [pubkey, favoriteRelays]) @@ -76,11 +69,8 @@ const ProfileArticles = forwardRef<{ refresh: () => void; getEvents: () => Event setIsRefreshing(true) } - console.log('[ProfileArticles] Fetching events for pubkey:', pubkey, isRetry ? `(retry ${retryCount + 1}/${maxRetries})` : '') - // Build comprehensive relay list including user's personal relays const comprehensiveRelays = await buildComprehensiveRelayList() - console.log('[ProfileArticles] Using comprehensive relay list:', comprehensiveRelays.length, 'relays') // Fetch longform articles (kind 30023), wiki articles (kinds 30817, 30818), publications (kind 30040), and highlights (kind 9802) const allEvents = await client.fetchEvents(comprehensiveRelays, { @@ -89,13 +79,6 @@ const ProfileArticles = forwardRef<{ refresh: () => void; getEvents: () => Event limit: 100 }) - console.log('[ProfileArticles] Fetched total events:', allEvents.length) - console.log('[ProfileArticles] Sample events:', allEvents.slice(0, 3).map(e => ({ id: e.id, kind: e.kind, content: e.content.substring(0, 50) + '...', tags: e.tags.slice(0, 3) }))) - - // Show ALL events (longform articles, wiki articles, publications, and highlights) - console.log('[ProfileArticles] Showing all events (articles + publications + highlights):', allEvents.length) - console.log('[ProfileArticles] Events sample:', allEvents.slice(0, 2).map(e => ({ id: e.id, kind: e.kind, content: e.content.substring(0, 50) + '...' }))) - const eventsToShow = allEvents // Sort by creation time (newest first) @@ -104,7 +87,6 @@ const ProfileArticles = forwardRef<{ refresh: () => void; getEvents: () => Event // If initial load returns 0 events but it's not a retry, wait and retry once // This handles cases where relays return "too many concurrent REQS" and return empty results if (!isRetry && !isRefresh && eventsToShow.length === 0 && retryCount === 0) { - console.log('[ProfileArticles] Got 0 events on initial load, retrying after delay...') setTimeout(() => { setRetryCount(prev => prev + 1) fetchArticles(true) @@ -136,7 +118,6 @@ const ProfileArticles = forwardRef<{ refresh: () => void; getEvents: () => Event // If this is not a retry and we haven't exceeded max retries, schedule a retry if (!isRetry && retryCount < maxRetries) { - console.log('[ProfileArticles] Scheduling retry', retryCount + 1, 'of', maxRetries) // Use shorter delays for initial retries, then exponential backoff const delay = retryCount === 0 ? 1000 : retryCount === 1 ? 2000 : 3000 setTimeout(() => { diff --git a/src/components/Profile/ProfileFeed.tsx b/src/components/Profile/ProfileFeed.tsx index 3bfbad3..af0020b 100644 --- a/src/components/Profile/ProfileFeed.tsx +++ b/src/components/Profile/ProfileFeed.tsx @@ -15,7 +15,6 @@ interface ProfileFeedProps { } const ProfileFeed = forwardRef<{ refresh: () => void }, ProfileFeedProps>(({ pubkey, topSpace, searchQuery = '' }, ref) => { - console.log('[ProfileFeed] Component rendered with pubkey:', pubkey) const [events, setEvents] = useState([]) const [isLoading, setIsLoading] = useState(true) const [retryCount, setRetryCount] = useState(0) @@ -45,14 +44,8 @@ const ProfileFeed = forwardRef<{ refresh: () => void }, ProfileFeedProps>(({ pub const uniqueRelays = Array.from(new Set(normalizedRelays)) - console.log('[ProfileFeed] Comprehensive relay list:', uniqueRelays.length, 'relays') - console.log('[ProfileFeed] User relays (read):', userRelayList.read?.length || 0) - console.log('[ProfileFeed] User relays (write):', userRelayList.write?.length || 0) - console.log('[ProfileFeed] Favorite relays:', favoriteRelays?.length || 0) - return uniqueRelays } catch (error) { - console.warn('[ProfileFeed] Error building relay list, using fallback:', error) return FAST_READ_RELAY_URLS } }, [pubkey, favoriteRelays]) @@ -74,11 +67,8 @@ const ProfileFeed = forwardRef<{ refresh: () => void }, ProfileFeedProps>(({ pub setIsRefreshing(true) } - console.log('[ProfileFeed] Fetching events for pubkey:', pubkey, isRetry ? `(retry ${retryCount + 1}/${maxRetries})` : '') - // Build comprehensive relay list including user's personal relays const comprehensiveRelays = await buildComprehensiveRelayList() - console.log('[ProfileFeed] Using comprehensive relay list:', comprehensiveRelays.length, 'relays') // Now try to fetch text notes specifically const allEvents = await client.fetchEvents(comprehensiveRelays, { @@ -87,13 +77,6 @@ const ProfileFeed = forwardRef<{ refresh: () => void }, ProfileFeedProps>(({ pub limit: 100 }) - console.log('[ProfileFeed] Fetched total events:', allEvents.length) - console.log('[ProfileFeed] Sample events:', allEvents.slice(0, 3).map(e => ({ id: e.id, content: e.content.substring(0, 50) + '...', tags: e.tags.slice(0, 3) }))) - - // Show ALL events (both top-level posts and replies) - console.log('[ProfileFeed] Showing all events (posts + replies):', allEvents.length) - console.log('[ProfileFeed] Events sample:', allEvents.slice(0, 2).map(e => ({ id: e.id, content: e.content.substring(0, 50) + '...' }))) - const eventsToShow = allEvents // Sort by creation time (newest first) @@ -102,7 +85,6 @@ const ProfileFeed = forwardRef<{ refresh: () => void }, ProfileFeedProps>(({ pub // If initial load returns 0 events but it's not a retry, wait and retry once // This handles cases where relays return "too many concurrent REQS" and return empty results if (!isRetry && !isRefresh && eventsToShow.length === 0 && retryCount === 0) { - console.log('[ProfileFeed] Got 0 events on initial load, retrying after delay...') setTimeout(() => { setRetryCount(prev => prev + 1) fetchPosts(true) @@ -134,7 +116,6 @@ const ProfileFeed = forwardRef<{ refresh: () => void }, ProfileFeedProps>(({ pub // If this is not a retry and we haven't exceeded max retries, schedule a retry if (!isRetry && retryCount < maxRetries) { - console.log('[ProfileFeed] Scheduling retry', retryCount + 1, 'of', maxRetries) // Use shorter delays for initial retries, then exponential backoff const delay = retryCount === 0 ? 1000 : retryCount === 1 ? 2000 : 3000 setTimeout(() => { diff --git a/src/constants.ts b/src/constants.ts index 81728c4..2c14d76 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -173,7 +173,7 @@ export const SUPPORTED_KINDS = [ ExtendedKind.PUBLICATION, ExtendedKind.WIKI_ARTICLE, ExtendedKind.WIKI_ARTICLE_MARKDOWN, - ExtendedKind.PUBLICATION_CONTENT, + // ExtendedKind.PUBLICATION_CONTENT, // Excluded - publication content should only be embedded in publications // NIP-89 Application Handlers ExtendedKind.APPLICATION_HANDLER_RECOMMENDATION, ExtendedKind.APPLICATION_HANDLER_INFO diff --git a/src/hooks/useFetchWebMetadata.tsx b/src/hooks/useFetchWebMetadata.tsx index 280e7c5..9f97c93 100644 --- a/src/hooks/useFetchWebMetadata.tsx +++ b/src/hooks/useFetchWebMetadata.tsx @@ -7,20 +7,16 @@ export function useFetchWebMetadata(url: string) { useEffect(() => { if (!url) { - console.log('[useFetchWebMetadata] No URL provided') return } - console.log(`[useFetchWebMetadata] Fetching metadata for URL: ${url}`) - // Pass original URL - web service will handle proxy conversion webService.fetchWebMetadata(url) .then((metadata) => { - console.log(`[useFetchWebMetadata] Received metadata for ${url}:`, metadata) setMetadata(metadata) }) - .catch((error) => { - console.error(`[useFetchWebMetadata] Error fetching metadata for ${url}:`, error) + .catch(() => { + // Silent fail }) }, [url]) diff --git a/src/lib/error-suppression.ts b/src/lib/error-suppression.ts index 518c689..ba856e8 100644 --- a/src/lib/error-suppression.ts +++ b/src/lib/error-suppression.ts @@ -94,6 +94,16 @@ export function suppressExpectedErrors() { return } + // Suppress WebSocket connection errors + if (message.includes('WebSocket connection to') || message.includes('failed:') || message.includes('Close received after close')) { + return + } + + // Suppress Ping timeout errors + if (message.includes('Ping timeout')) { + return + } + // Call original console.error for unexpected errors originalConsoleError.apply(console, args) } @@ -112,9 +122,38 @@ export function suppressExpectedErrors() { suppressedErrors.add('react-devtools') } + // Suppress Workbox warnings + if (message.includes('workbox') && ( + message.includes('will not be cached') || + message.includes('Network request for') || + message.includes('returned a response with status') + )) { + return + } + // Call original console.warn for unexpected warnings originalConsoleWarn.apply(console, args) } + + // Override console.log to filter out expected logs + const originalConsoleLog = console.log + + console.log = (...args: any[]) => { + const message = args.join(' ') + + // Suppress Workbox logs + if (message.includes('workbox') || message.includes('[NoteStats]')) { + return + } + + // Suppress nostr-tools notices (ping, etc.) + if (message.includes('NOTICE from')) { + return + } + + // Call original console.log for unexpected logs + originalConsoleLog.apply(console, args) + } } // Initialize error suppression diff --git a/src/services/client.service.ts b/src/services/client.service.ts index de09419..75c71c4 100644 --- a/src/services/client.service.ts +++ b/src/services/client.service.ts @@ -553,8 +553,8 @@ class ClientService extends EventTarget { .then((sub) => { sub.close() }) - .catch((err) => { - console.error(err) + .catch(() => { + // Silent fail }) }) } @@ -895,7 +895,6 @@ class ClientService extends EventTarget { this.trendingNotesCache = events return this.trendingNotesCache } catch (error) { - console.error('fetchTrendingNotes error', error) return [] } } @@ -1020,7 +1019,6 @@ class ClientService extends EventTarget { return relays } catch (error) { - console.warn('[ClientService] Error fetching user favorite relays:', error) return [] } } @@ -1058,7 +1056,7 @@ class ClientService extends EventTarget { }) } } catch (error) { - console.warn('[ClientService] Error fetching user relay list:', error) + // Silent fail } } @@ -1473,7 +1471,7 @@ class ClientService extends EventTarget { } }) } catch (error) { - console.warn('[ClientService] Error fetching cache relay events:', error) + // Silent fail } } diff --git a/src/services/local-storage.service.ts b/src/services/local-storage.service.ts index ff67bea..02df46e 100644 --- a/src/services/local-storage.service.ts +++ b/src/services/local-storage.service.ts @@ -211,10 +211,17 @@ class LocalStorageService { showKinds.push(ExtendedKind.WIKI_ARTICLE) } } + if (showKindsVersion < 5) { + // Remove publication content from existing users' filters (should only be embedded) + const pubContentIndex = showKinds.indexOf(ExtendedKind.PUBLICATION_CONTENT) + if (pubContentIndex !== -1) { + showKinds.splice(pubContentIndex, 1) + } + } this.showKinds = showKinds } window.localStorage.setItem(StorageKey.SHOW_KINDS, JSON.stringify(this.showKinds)) - window.localStorage.setItem(StorageKey.SHOW_KINDS_VERSION, '4') + window.localStorage.setItem(StorageKey.SHOW_KINDS_VERSION, '5') this.hideContentMentioningMutedUsers = window.localStorage.getItem(StorageKey.HIDE_CONTENT_MENTIONING_MUTED_USERS) === 'true' diff --git a/src/services/note-stats.service.ts b/src/services/note-stats.service.ts index 818f353..531ffaa 100644 --- a/src/services/note-stats.service.ts +++ b/src/services/note-stats.service.ts @@ -86,7 +86,6 @@ class NoteStatsService { this.batchTimeout = null } - console.log('[NoteStats] Processing batch of', eventsToProcess.length, 'events') // Process all events in the batch await Promise.all(eventsToProcess.map(eventId => this.processSingleEvent(eventId)))