122 Commits

Author SHA1 Message Date
e07a2cae53 lint fix wip 2026-01-06 18:03:18 +01:00
c1442886cf lint fix wip 2026-01-06 17:45:45 +01:00
5b7b77aa9a lint fix wip 2026-01-06 17:10:07 +01:00
cc84d85193 lint fix wip 2026-01-06 16:44:12 +01:00
0e856d958e lint fix wip 2026-01-06 16:37:26 +01:00
cc0f3816fa lint fix wip 2026-01-06 16:35:15 +01:00
ccf2fdf759 lint fix wip 2026-01-06 16:10:08 +01:00
303c0bf7df lint fix wip 2026-01-06 15:57:34 +01:00
390f895920 lint fix wip 2026-01-06 15:41:58 +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
52bd9492b7 lint fix wip 2026-01-06 15:11:52 +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
cc49c9d7c1 Add language preference selector in settings
**Motivations:**
- Allow users to set their preferred language (fr/en) in the settings page
- Load language preference from localStorage at startup to configure the application locale

**Root causes:**
- Language preference was only available in the header via LanguageSelector component
- Language preference was stored in IndexedDB instead of localStorage
- No centralized language settings management in the settings page

**Correctifs:**
- Created LanguageSettingsManager component for settings page
- Migrated language storage from IndexedDB to localStorage for consistency
- Updated _app.tsx to load locale from localStorage synchronously at startup
- Updated useI18n hook to use localStorage instead of IndexedDB
- Updated LanguageSelector component to use localStorage instead of IndexedDB

**Evolutions:**
- Added language preference section in settings page (displayed first)
- Language preference is now loaded at application startup from localStorage
- Added translations for language settings (settings.language.*)

**Pages affectées:**
- components/LanguageSettingsManager.tsx (new)
- pages/settings.tsx
- pages/_app.tsx
- hooks/useI18n.ts
- components/LanguageSelector.tsx
- locales/fr.txt
- locales/en.txt
2026-01-06 14:57:38 +01:00
8e7d234e68 lint fix wip3 2026-01-06 14:48:13 +01:00
1c9f3a2afa lint fix wip3 2026-01-06 14:41:02 +01:00
ba5f4a6cc4 lint fix wip3 2026-01-06 14:38:38 +01:00
f6cd63a34d lint fix wip3 2026-01-06 14:33:32 +01:00
20032c00ae lint fix wip2 2026-01-06 14:28:19 +01:00
a219d1ad42 lint fix wip2 2026-01-06 14:24:35 +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
5ac5aab089 series wip & code quality checks 2026-01-06 09:26:07 +01:00
572ee2dde5 fix key import 2026-01-06 08:10:43 +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
4a619c9576 series building 2026-01-05 23:37:29 +01:00
4787bd5410 Fix: profil image2 2026-01-05 23:24:10 +01:00
a058056475 Fix: profil image2 2026-01-05 23:07:12 +01:00
4e3254a078 Temporarily enable nostrimg.com for diagnostic logging
**Motivations:**
- Enable nostrimg.com to see detailed diagnostic logs
- Verify if the issue is code-related or server-side
- Collect logs to diagnose 500 errors

**Root causes:**
- Need to see actual request/response logs to diagnose the issue

**Correctifs:**
- Temporarily enabled nostrimg.com (enabled: true)
- Added comment indicating it's for diagnostic purposes
- Detailed logging already in place to capture request/response details

**Evolutions:**
- None

**Pages affectées:**
- lib/configStorageTypes.ts
2026-01-05 22:57:13 +01:00
2b5df250f6 Improve NIP-98 error messages and disable nostrimg.com by default
**Motivations:**
- Provide clearer error messages when NIP-98 authentication is not available
- Disable nostrimg.com by default since it returns server errors (500)
- Help users understand why nostrcheck.me endpoint is skipped

**Root causes:**
- NIP-98 authentication requires unlocked account but error message was generic
- nostrimg.com endpoint consistently returns 500 errors
- Users don't understand why nostrcheck.me is skipped

**Correctifs:**
- Added detailed error messages for NIP-98 unavailability:
  - No account: 'Please create or import an account'
  - Account not unlocked: 'Please unlock your account with your recovery phrase'
- Disabled nostrimg.com by default (enabled: false) due to server errors
- Improved console warnings with specific reasons for skipping endpoints

**Evolutions:**
- None

**Pages affectées:**
- lib/nip95.ts
- lib/configStorageTypes.ts
2026-01-05 22:53:45 +01:00
d7a04dd8f8 Fix nsec import validation for Uint8Array data
**Motivations:**
- Fix import error when importing nsec private keys
- Support both string and Uint8Array formats from nip19.decode

**Root causes:**
- nip19.decode returns decoded.data as Uint8Array, not string
- Validation in KeyManagementManager only checked for string type
- importPrivateKey in keyManagement.ts only handled string type

**Correctifs:**
- Updated KeyManagementManager validation to accept Uint8Array
- Updated importPrivateKey to convert Uint8Array to hex using bytesToHex
- Improved error messages to show actual validation errors

**Evolutions:**
- None

**Pages affectées:**
- components/KeyManagementManager.tsx
- lib/keyManagement.ts
2026-01-05 22:38:21 +01:00
57ac98ebe4 Fix: NIP-95 upload 500 error 2026-01-05 22:14:01 +01:00
b5ec69624c Fix: NIP-95 upload 500 error 2026-01-05 22:07:11 +01:00
d8311078bc Fix: NIP-95 upload 500 error 2026-01-05 21:56:09 +01:00
a90b77cec3 Fix: NIP-95 upload 500 error 2026-01-05 21:22:49 +01:00
17aa64070e Change default NIP-95 endpoint to void.cat as nostr.build returns 405 2025-12-29 00:59:04 +01:00
35d4a94bb4 Change default NIP-95 endpoint back to nostr.build for proxy usage 2025-12-29 00:33:12 +01:00
0533122919 Always use proxy for all NIP-95 uploads to avoid all endpoint issues 2025-12-29 00:32:01 +01:00
a4820da2df Use proxy for all NIP-95 uploads to avoid CORS and endpoint issues, improve error logging 2025-12-29 00:30:54 +01:00
bafd8ca0bc Change default NIP-95 endpoint to picstr.build and fix proxy to accept endpoint parameter 2025-12-29 00:27:00 +01:00
7bab834f89 Fix multipart parsing in NIP-95 upload proxy by removing manual Content-Type header and improving error handling 2025-12-29 00:23:00 +01:00
2b57b1d445 Add proxy API endpoint for NIP-95 upload to bypass CORS issues with nostr.build 2025-12-29 00:17:10 +01:00
07b9f513bb Change default NIP-95 endpoint to nostrcheck.me as void.cat is not accessible 2025-12-29 00:10:03 +01:00
333c8e4d7f Fix CORS issue by changing default NIP-95 endpoint to void.cat and adding fallback to try multiple endpoints 2025-12-28 23:41:52 +01:00
a2656ef3f8 Fix: Replace pool.sub() with createSubscription() for nostr-tools 2.19.4 compatibility 2025-12-28 22:56:34 +01:00
b8daab2bcd Remove initializeCookieCleanup function and migration code 2025-12-28 22:38:34 +01:00
42e3e7e692 Update all dependencies to latest versions and fix compatibility issues
**Motivations:**
- Keep dependencies up to date for security and features
- Automate dependency updates in deployment script
- Fix compatibility issues with major version updates (React 19, Next.js 16, nostr-tools 2.x)

**Root causes:**
- Dependencies were outdated
- Deployment script did not update dependencies before deploying
- Major version updates introduced breaking API changes

**Correctifs:**
- Updated all dependencies to latest versions using npm-check-updates
- Modified deploy.sh to run npm-check-updates before installing dependencies
- Fixed nostr-tools 2.x API changes (generatePrivateKey -> generateSecretKey, signEvent -> finalizeEvent, verifySignature -> verifyEvent)
- Fixed React 19 ref types to accept null
- Fixed JSX namespace issues (JSX.Element -> React.ReactElement)
- Added proper types for event callbacks
- Fixed SimplePool.sub typing issues with type assertions

**Evolutions:**
- Deployment script now automatically updates dependencies to latest versions before deploying
- All dependencies updated to latest versions (Next.js 14->16, React 18->19, nostr-tools 1->2, etc.)

**Pages affectées:**
- package.json
- deploy.sh
- lib/keyManagement.ts
- lib/nostr.ts
- lib/nostrRemoteSigner.ts
- lib/zapVerification.ts
- lib/platformTrackingEvents.ts
- lib/sponsoringTracking.ts
- lib/articlePublisherHelpersVerification.ts
- lib/contentDeliveryVerification.ts
- lib/paymentPollingZapReceipt.ts
- lib/nostrPrivateMessages.ts
- lib/nostrSubscription.ts
- lib/nostrZapVerification.ts
- lib/markdownRenderer.tsx
- components/AuthorFilter.tsx
- components/AuthorFilterButton.tsx
- components/UserArticlesList.tsx
- types/nostr-tools-extended.ts
2025-12-28 21:49:19 +01:00
46d5f03fbe Remove connection button and replace with direct account creation/import options 2025-12-28 20:35:50 +01:00