mirror of
https://github.com/dergigi/boris.git
synced 2025-12-26 19:14:52 +01:00
debug: add detailed logging for highlight fetching
- Log article details (event ID, author, kind, d-tag, coordinate) - Log filter being used for highlight queries - Log sample highlight tags when found - This will help debug why highlights aren't showing
This commit is contained in:
2
dist/index.html
vendored
2
dist/index.html
vendored
@@ -5,7 +5,7 @@
|
||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Boris - Nostr Bookmarks</title>
|
||||
<script type="module" crossorigin src="/assets/index-BzeJHmVT.js"></script>
|
||||
<script type="module" crossorigin src="/assets/index-h7fLeUhN.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-Dljx1pJR.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -73,6 +73,14 @@ const Bookmarks: React.FC<BookmarksProps> = ({ relayPool, onLogout }) => {
|
||||
const dTag = article.event.tags.find(t => t[0] === 'd')?.[1] || ''
|
||||
const articleCoordinate = `${article.event.kind}:${article.author}:${dTag}`
|
||||
|
||||
console.log('📰 Article details:')
|
||||
console.log(' - Event ID:', article.event.id)
|
||||
console.log(' - Author:', article.author)
|
||||
console.log(' - Kind:', article.event.kind)
|
||||
console.log(' - D-tag:', dTag)
|
||||
console.log(' - Coordinate:', articleCoordinate)
|
||||
console.log(' - Title:', article.title)
|
||||
|
||||
try {
|
||||
setHighlightsLoading(true)
|
||||
const fetchedHighlights = await fetchHighlightsForArticle(relayPool, articleCoordinate)
|
||||
|
||||
@@ -50,6 +50,7 @@ export const fetchHighlightsForArticle = async (
|
||||
|
||||
console.log('🔍 Fetching highlights (kind 9802) for article:', articleCoordinate)
|
||||
console.log('🔍 From relays:', highlightRelays)
|
||||
console.log('🔍 Filter:', JSON.stringify({ kinds: [9802], '#a': [articleCoordinate] }, null, 2))
|
||||
|
||||
// Query for highlights that reference this article via the 'a' tag
|
||||
const rawEvents = await lastValueFrom(
|
||||
@@ -59,6 +60,9 @@ export const fetchHighlightsForArticle = async (
|
||||
)
|
||||
|
||||
console.log('📊 Raw highlight events fetched:', rawEvents.length)
|
||||
if (rawEvents.length > 0) {
|
||||
console.log('📄 Sample highlight tags:', JSON.stringify(rawEvents[0].tags, null, 2))
|
||||
}
|
||||
|
||||
// Deduplicate events by ID
|
||||
const uniqueEvents = dedupeHighlights(rawEvents)
|
||||
|
||||
Reference in New Issue
Block a user