25 Commits

Author SHA1 Message Date
9e76a9e18a lint fix 2026-01-09 13:13:24 +01:00
526fb5af6f lint fix wip 2026-01-09 09:22:30 +01:00
7c0dc68304 lint fix wip 2026-01-09 08:45:54 +01:00
9e3d2c8742 lint fix wip 2026-01-09 02:26:48 +01:00
38941147cb lint fix wip 2026-01-09 01:49:57 +01:00
20a46ce2bc lint fix wip 2026-01-08 23:04:56 +01:00
5694dbdb8a lint fix wip 2026-01-08 21:49:57 +01:00
ddda722141 lint fix wip 2026-01-07 11:36:24 +01:00
dace103da8 lint fix wip 2026-01-07 03:45:01 +01:00
b2e6250ff5 lint fix wip 2026-01-07 01:51:26 +01:00
7fdd71278e lint fix wip 2026-01-07 00:05:01 +01:00
b7d65a55c7 lint fix wip 2026-01-06 21:16:28 +01:00
9e364d0313 lint fix wip 2026-01-06 18:47:12 +01:00
303c0bf7df lint fix wip 2026-01-06 15:57:34 +01:00
29cb20c614 Fix authors not loading from cache on startup
**Motivations:**
- Authors were not being loaded from cache, causing 'Aucun contenu trouvé' message even when authors exist
- useArticles only loaded articles from Nostr subscription, not authors from cache
- Authors should be loaded from cache first (cache-first architecture)

**Root causes:**
- useArticles hook only subscribed to articles from Nostr, not loading authors from cache
- No method to get all authors from cache
- Authors were only extracted from articles returned by subscription, which may not include author presentations

**Correctifs:**
- Added getAll method to objectCache to retrieve all objects of a type from cache
- Modified useArticles to load authors from cache on startup before subscribing to Nostr
- Authors are now loaded from cache and merged with articles from subscription
- totalSponsoring is calculated for each author when loading from cache

**Evolutions:**
- Authors are now available immediately from cache on page load
- Better user experience: no 'Aucun contenu trouvé' when authors exist in cache
- Cache-first architecture: authors loaded from cache before Nostr subscription

**Pages affectées:**
- lib/objectCache.ts
- hooks/useArticles.ts
2026-01-06 15:33:02 +01:00
f5d9033183 Refactor to use cache-first architecture with background sync
**Motivations:**
- total_sponsoring should be calculated from cache, not stored in tags
- Author searches should use cache first, not query Nostr directly
- All elements should be read/written from/to database
- Background sync should scan all notes with service='zapwall.fr' tag and update cache
- Sync should run at startup and resume on each page navigation

**Root causes:**
- total_sponsoring was stored in tags which required updates on every sponsoring payment
- Author queries were querying Nostr directly instead of using cache
- No background sync service to keep cache up to date with new notes

**Correctifs:**
- Removed totalSponsoring from AuthorTags interface and buildAuthorTags
- Modified getAuthorSponsoring to calculate from cache (sponsoring queries) instead of tags
- Modified parsePresentationEvent to set totalSponsoring to 0 (calculated on demand from cache)
- Modified fetchAuthorByHashId and fetchAuthorPresentationFromPool to use cache first and calculate totalSponsoring from cache
- Created platformSyncService that scans all notes with service='zapwall.fr' tag and caches them
- Modified _app.tsx to start continuous sync on mount and resume on page navigation
- All author presentations now calculate totalSponsoring from cache when loaded

**Evolutions:**
- Cache-first architecture: all queries check cache before querying Nostr
- Background sync service keeps cache up to date automatically
- totalSponsoring is always calculated from actual sponsoring data in cache
- Better performance: cache queries are faster than Nostr queries
- Non-blocking sync: background sync doesn't block UI

**Pages affectées:**
- lib/nostrTagSystemTypes.ts
- lib/nostrTagSystemBuild.ts
- lib/articlePublisherHelpersPresentation.ts
- lib/sponsoring.ts
- lib/authorQueries.ts
- lib/platformSync.ts (new)
- pages/_app.tsx
2026-01-06 15:04:14 +01:00
13e0e0d801 lint fix wip 2026-01-06 14:17:55 +01:00
412989e6af lint fix wip 2026-01-06 11:30:23 +01:00
a4a39fd0ba fix 'Chargement..' for profil 2026-01-06 01:11:20 +01:00
05382f34ab series building 2026-01-06 00:54:49 +01:00
ba0fcbfc96 series building 2026-01-06 00:37:49 +01:00
758ab5c966 series building 2026-01-06 00:26:31 +01:00
4787bd5410 Fix: profil image2 2026-01-05 23:24:10 +01:00
a2656ef3f8 Fix: Replace pool.sub() with createSubscription() for nostr-tools 2.19.4 compatibility 2025-12-28 22:56:34 +01:00
46d5f03fbe Remove connection button and replace with direct account creation/import options 2025-12-28 20:35:50 +01:00