Commit Graph
2640 Commits
Author SHA1 Message Date
google-labs-jules[bot] 7312fa4fa4 Fix watch history hydration using local cache and address support
Updated `createWatchHistoryHydrationStage` in `js/feedEngine/watchHistoryFeed.js` to first check `nostrClient.allEvents` for video data before querying relays. This ensures that recently watched videos (which are already in memory) are instantly hydrated in the watch history list, fixing the "Untitled video" issue.

Additionally, implemented robust support for hydrating address pointers (`type: 'a'`) by scanning the cache and constructing proper relay filters for missing items. This covers cases where history items reference videos by `kind:pubkey:d-tag` rather than ID.
2026-01-06 04:06:44 +00:00
google-labs-jules[bot] 914e0abc58 Fix watch history hydration for address pointers with colons
Updated `createWatchHistoryHydrationStage` in `js/feedEngine/watchHistoryFeed.js` to properly handle and hydrate watch history items that use address pointers (type 'a'), specifically fixing a bug where d-tags containing colons were being ignored.

Previously, only event ID pointers (type 'e') were being hydrated, and an initial fix for addresses failed for d-tags with colons. This change robustly parses address pointers, constructs appropriate filters, fetches the events, and correctly maps them back to the history items using a `normalizeAddressKey` utility that handles mixed-case pubkeys and complex d-tags.
2026-01-06 03:43:08 +00:00
google-labs-jules[bot] 1f54745840 Fix watch history hydration for address pointers
Updated `createWatchHistoryHydrationStage` in `js/feedEngine/watchHistoryFeed.js` to properly handle and hydrate watch history items that use address pointers (type 'a').

Previously, only event ID pointers (type 'e') were being hydrated, causing videos watched via address pointers to display as "Untitled video" with missing metadata. This change parses the address pointers, constructs appropriate filters (normalizing pubkeys to lowercase while preserving d-tag case), fetches the events, and correctly maps them back to the history items using a robust `normalizeAddressKey` utility.
2026-01-06 03:23:45 +00:00
google-labs-jules[bot] 5724ec4e1e Fix watch history hydration for address pointers
Updated `createWatchHistoryHydrationStage` in `js/feedEngine/watchHistoryFeed.js` to properly handle and hydrate watch history items that use address pointers (type 'a').

Previously, only event ID pointers (type 'e') were being hydrated, causing videos watched via address pointers to display as "Untitled video" with missing metadata. This change parses the address pointers, constructs appropriate filters, fetches the events, and correctly maps them back to the history items.
2026-01-06 02:51:18 +00:00
thePR0M3TH3AN ae37652e70 Merge pull request #1088 from PR0M3TH3AN/fix-missing-session-actor-for-anonymous-users-1168164604446584559
Fix missing session actor for anonymous users
2026-01-05 21:40:43 -05:00
google-labs-jules[bot] a7b3f5572b Fix missing session actor for anonymous users
- Update `mintSessionActor` in `js/nostr/client.js` to support `nostr-tools` v2 `generateSecretKey` and properly handle `getPublicKey` input (hex vs bytes).
- Ensure `ensureSessionActor` awaits `ensureNostrTools()` before attempting to mint a new actor.
- This resolves the issue where video view events and watch history updates failed for non-logged-in users with a "missing-actor" error.
2026-01-06 02:38:56 +00:00
thePR0M3TH3AN 4bc2eee9fe Merge pull request #1087 from PR0M3TH3AN/fix-console-log-spam-issues-1377412273382264295
fix(nostr): restore video grid loading and session actor creation
2026-01-05 21:28:29 -05:00
thePR0M3TH3AN f0c533efb6 Merge pull request #1086 from PR0M3TH3AN/revert-1085-fix-console-log-spam-issues-1377412273382264295
Revert "fix(logs): suppress dm sync spam and allow local image paths"
2026-01-05 21:26:58 -05:00
thePR0M3TH3AN 8a4e4754f2 Revert "fix(logs): suppress dm sync spam and allow local image paths" 2026-01-05 21:26:32 -05:00
google-labs-jules[bot] 1f001c23d2 fix(nostr): restore video grid loading and session actor creation 2026-01-06 02:21:00 +00:00
thePR0M3TH3AN 9e685b6b6a Merge pull request #1085 from PR0M3TH3AN/fix-console-log-spam-issues-1377412273382264295
fix(logs): suppress dm sync spam and allow local image paths
2026-01-05 16:44:03 -05:00
google-labs-jules[bot] c64d70ad88 fix(nostr): restore session actor creation for view counts 2026-01-05 21:41:58 +00:00
google-labs-jules[bot] 5ed5554f51 fix(logs): suppress dm sync spam and allow local image paths 2026-01-05 21:23:32 +00:00
thePR0M3TH3AN b24aac7349 dev mode on 2026-01-05 16:16:38 -05:00
thePR0M3TH3AN 7dbedf0438 Merge pull request #1084 from PR0M3TH3AN/fix-view-counter-reliability-11006209744575726503
Retain stale view counts to prevent display regression
2026-01-05 16:14:47 -05:00
google-labs-jules[bot] acd2104067 Fix(startup): Defer trusted seed bootstrapping until after Nostr init
- Moves `bootstrapTrustedSeeds` logic from `js/bootstrap.js` to a new service `js/services/trustBootstrap.js`.
- Updates `js/app.js` to explicitly await `nostrClient.init()` before calling `bootstrapTrustedSeeds()`, resolving race conditions where admin lists were fetched before the relay pool was ready.
- Ensures `waitForRelaysReady` checks for `nostrClient.pool` existence.
2026-01-05 21:12:04 +00:00
google-labs-jules[bot] ac071cb74e Fix(viewCounter): Retain stale view counts for smoother hydration
- Removes the logic in `restoreCacheSnapshot` that deleted cached view counts if they were older than `VIEW_COUNT_CACHE_TTL_MS`.
- Updates `tests/view-counter.test.mjs` to assert that stale cache data is preserved and used as a baseline during hydration, preventing view counts from dropping to zero or lower fallback values during network issues.
2026-01-05 21:01:53 +00:00
thePR0M3TH3AN 5ad9dee85b Merge pull request #1083 from PR0M3TH3AN/watch-history-hydration-improvement-14056519037250996205
Implement video hydration stage for watch history feed
2026-01-05 15:47:30 -05:00
google-labs-jules[bot] 99c3f60a23 feat: implement video hydration stage for watch history feed
This introduces a new stage in the watch history feed pipeline that fetches missing video metadata from relays. Since watch history storage was optimized to store only event IDs, this hydration step ensures that the UI can display titles and thumbnails without requiring them to be persisted in the history payload itself.

- Implemented `createWatchHistoryHydrationStage` in `js/feedEngine/watchHistoryFeed.js`.
- Integrated `convertEventToVideo` to transform fetched events into usable video objects.
- Added a comprehensive integration test in `tests/watch-history.test.mjs` verifying the full flow from ID-only storage to hydrated feed items.
2026-01-05 20:22:34 +00:00
thePR0M3TH3AN 23316d28ba Merge pull request #1082 from PR0M3TH3AN/watch-history-monthly-pagination-18371774738792903843
Implement monthly watch history pagination and backend support
2026-01-05 15:03:18 -05:00
google-labs-jules[bot] 27d80ff070 feat: implement monthly watch history pagination
- Updated `js/historyView.js` to load history month-by-month and implement infinite scroll.
- Updated `js/watchHistoryService.js` and `js/nostr/watchHistory.js` to support fetching specific monthly buckets (`YYYY-MM`).
- Updated `js/nostr/client.js` to expose `fetchWatchHistoryMonth`.
- Updated `views/history.html` copy to reflect monthly/server-side storage and remove references to local caching/encryption.
- Ensure item removal targets the correct monthly bucket.
2026-01-05 20:00:59 +00:00
thePR0M3TH3AN d337fb90ad Merge pull request #1081 from PR0M3TH3AN/update-history-view-copy-11310022164629372395
Update history view copy for event ID-only tracking
2026-01-05 14:21:14 -05:00
google-labs-jules[bot] 89ce081453 Update history view copy to reflect event ID-only tracking
- Rename "Clear local cache" button to "Clear local history"
- Update info text to remove references to hydrating from session/caches
- Simplify copy to remove "encrypted" references in favor of "syncing" or "history"
- Update success/error messages to match new terminology
2026-01-05 19:17:51 +00:00
thePR0M3TH3AN f7fa86682f Merge pull request #1080 from PR0M3TH3AN/remove-metadata-toggle-history-1300345743199644564
Remove metadata toggle from watch history pane
2026-01-05 14:08:58 -05:00
google-labs-jules[bot] 3096f02e40 Remove metadata toggle from watch history pane
Removed the metadata toggle UI and related logic from the watch history implementation.
- Updated `components/profile-modal.html` to remove the UI block.
- Cleaned up `js/ui/profileModalController.js` and `js/historyView.js` to drop metadata preference state and handlers.
- Updated `tests/watch-history.test.mjs` to remove obsolete test cases referencing `metadataPreference`.
2026-01-05 18:56:58 +00:00
thePR0M3TH3AN d43568dd03 Merge pull request #1079 from PR0M3TH3AN/simplify-watch-history-metadata-13037020337635795983
Simplify Watch History Metadata Handling
2026-01-05 12:03:20 -05:00
google-labs-jules[bot] 4c7230f540 Remove metadata storage and handling from watch history
Removes the metadata argument from `WatchHistoryService.publishView` and cleans up the associated caching and resolution logic in `watchHistory.js` and `watchHistoryFeed.js`. Deletes `js/watchHistoryMetadata.js` as it is no longer used.

This simplification ensures watch history strictly manages pointers and timestamps, leaving metadata resolution to higher-level consumers. It also reduces the payload size and complexity of persisted history records.

Tests have been updated to reflect the API changes.
2026-01-05 16:58:59 +00:00
thePR0M3TH3AN bb17ed86e3 Merge pull request #1078 from PR0M3TH3AN/update-watch-history-upsert-15220237728172576450
Refactor watch history service to use idempotent monthly upsert
2026-01-05 10:44:33 -05:00
google-labs-jules[bot] ac3873e5d7 Refactor watch history service to use idempotent monthly upsert logic.
Removes legacy snapshot/chunk retry scheduling in favor of a monthly upsert approach.
Updates state persistence to remove `pendingSnapshotId`.
Fixes race condition in `scheduleRepublishForQueue` by using selective queue pruning.
Ensures data is not lost on publish failure in `snapshot`.
Updates tests to align with new architecture.
2026-01-05 15:42:48 +00:00
thePR0M3TH3AN 463def17bd Merge pull request #1077 from PR0M3TH3AN/update-watch-history-plaintext-3969579951554816223
Refactor watch history to plaintext monthly buckets
2026-01-05 10:27:40 -05:00
google-labs-jules[bot] e9ba3f6681 Refactor watch history to use plaintext monthly buckets
- Update `js/nostrEventSchemas.js` to remove encryption tagging and update schema for `WATCH_HISTORY`.
- Update `js/nostr/watchHistory.js` to:
  - Bump storage version to 4.
  - Bucket items by `YYYY-MM`.
  - Publish plaintext JSON payloads with only event IDs and timestamps.
  - Remove encryption logic from publishing.
  - Update fetching to handle plaintext and fallback to legacy parsing.
- Update `js/watchHistoryService.js` to strip metadata from queued items and handle new snapshot response.
- Update `tests/watch-history.test.mjs` to reflect new plaintext behavior and disabled obsolete tests.
2026-01-05 15:26:31 +00:00
thePR0M3TH3AN 19a41892ed Merge pull request #1076 from PR0M3TH3AN/refactor-watch-history-schema-v3-17111495590354162850
Refactor Watch History to Single Monthly Schema
2026-01-05 09:54:04 -05:00
google-labs-jules[bot] 8293caf6d3 Refactor watch history to use simplified monthly record schema 2026-01-05 14:44:45 +00:00
thePR0M3TH3AN 25a3c53002 Merge pull request #1075 from PR0M3TH3AN/update-watch-history-tags-month-ids-12593711611362178428
Revise watch-history tags to use month IDs
2026-01-05 09:32:30 -05:00
google-labs-jules[bot] 498d9cb5b2 Revise watch-history tags to use month IDs
Refactors the watch-history system to prioritize `YYYY-MM` month identifiers over legacy snapshot IDs in event tags, storage keys, and cross-module references. Updates event schemas, storage keying (v3), and client interfaces to align with the new month-based structure. Renames `snapshotId` parameters to `taskId` for republishing operations.
2026-01-05 14:21:53 +00:00
thePR0M3TH3AN 50e2481e46 Merge pull request #1074 from PR0M3TH3AN/refactor-watch-history-monthly-buckets-5861179938557741617
Refactor Watch History to Monthly Buckets
2026-01-05 09:13:41 -05:00
google-labs-jules[bot] cc25635ce6 Refactor watch history to use monthly buckets (v3)
Refactors `js/nostr/watchHistory.js` to store and publish watch history items in monthly buckets (`YYYY-MM`) instead of using chunk splitting. Updates storage version to 3, migrates existing data, and simplifies fetch/merge logic to handle monthly records. Removes legacy chunk rebalancing code. Updates tests to verify monthly bucketing behavior.
2026-01-05 14:11:57 +00:00
thePR0M3TH3AN 1f940a06b4 Merge pull request #1073 from PR0M3TH3AN/watch-history-migration-monthly-4439173938950458575
Migrate watch history to monthly records
2026-01-05 08:47:52 -05:00
google-labs-jules[bot] 48d9ea60cb Refactor watch history to use monthly YYYY-MM records
- Updated `buildWatchHistoryPayload` to remove legacy `snapshotId` logic.
- Updated `publishSnapshot` to use `YYYY-MM` as the `d` tag identifier.
- Updated `fetch` logic to retrieve all history events (removing restrictive `#d` filter) to ensure complete history across months is loaded.
- Fixed a runtime error in `fetch` where `now` was undefined.
- Updated `js/nostrEventSchemas.js` to prioritize `monthIdentifier` for the `d` tag.
- Removed legacy `snapshot` field from payload serialization.
2026-01-05 03:41:30 +00:00
thePR0M3TH3AN 4c6eae2f14 Merge pull request #1072 from PR0M3TH3AN/refactor-watch-history-context-10244638915022032080
Refactor watch history context to month-centric fields
2026-01-04 22:29:18 -05:00
google-labs-jules[bot] a3c7536543 Refactor watch history to use month-centric context
- Rename `WATCH_HISTORY_CHUNK` schema to "Watch history monthly payload" in `js/nostrEventSchemas.js`.
- Update `js/nostr/watchHistory.js` to replace `snapshotId` with `recordId` and `monthIdentifier` in logging and error tracking context.
- Ensure `fetch` logic uses `recordId` and `month` in chunk decryption context for clarity.
- Fix indentation for added fields in logging objects.
2026-01-05 03:23:32 +00:00
thePR0M3TH3AN 79a983b3f4 Merge pull request #1071 from PR0M3TH3AN/update-watch-history-normalization-9579929584971128125
Update watch history normalization logic
2026-01-04 22:16:25 -05:00
google-labs-jules[bot] f2d0ce939a Update watch history normalization for monthly payload format
This change updates `normalizePointersFromPayload` to process both legacy `items` and new `events` arrays from the watch history payload. It also adds logic to merge `watchedAt` timestamps from a map, supporting the new monthly format. Additionally, `mergeWatchHistoryItemsWithFallback` is updated to rely on the unified `items` list and hydrate metadata from fallback items for all entries, ensuring robust handling of sparse event pointers.
2026-01-05 00:05:40 +00:00
thePR0M3TH3AN 4e8364764e Merge pull request #1070 from PR0M3TH3AN/refactor-watch-history-payload-v2-2612877448360263100
Refactor watch history to use monthly payload schema
2026-01-04 18:54:18 -05:00
google-labs-jules[bot] b79a8eb0d0 Refactor watch history to use monthly payload schema
* Redefine `parseWatchHistoryPayload` to support `month`, `events` (IDs), and `watchedAt` map.
* Update `mergeWatchHistoryItemsWithFallback` to merge new monthly fields with fallback items.
* Update `buildWatchHistoryPayload` to produce payloads with `events` instead of `items`.
* Update `WatchHistoryManager` to remove legacy chunk index handling.
* Ensure backward compatibility for legacy chunk payloads.
2026-01-04 22:15:27 +00:00
thePR0M3TH3AN 72f5a19cbb Merge pull request #1069 from PR0M3TH3AN/refactor-watch-history-single-event-16264182673393709707
Refactor watch history to single monthly event
2026-01-04 17:05:37 -05:00
google-labs-jules[bot] 595d4cbe07 Refactor watch history to use single monthly event
Replaces the legacy chunked storage architecture with a single encrypted event per month.
- Renames `buildWatchHistoryChunkEvent` to `buildWatchHistoryEvent`.
- Updates `WatchHistoryManager` to publish and fetch single events, maintaining read compatibility for legacy chunks.
- Simplifies payload construction and removes chunk indexing logic.
- Updates tests to verify single-event publishing and legacy fallback.
2026-01-04 22:03:34 +00:00
thePR0M3TH3AN ae949daee6 Merge pull request #1068 from PR0M3TH3AN/refactor-watch-history-single-payload-7716078754821307450
Refactor watch history to use single monthly payload event
2026-01-04 16:21:10 -05:00
google-labs-jules[bot] 34b835d4e1 Refactor watch history to use single monthly payload event
Replaces the chunked watch history implementation with a single monthly payload.
This simplifies the event structure and removes chunking logic while maintaining backward compatibility for reading legacy chunked events.
Updates `parseWatchHistoryPayload`, `buildWatchHistoryPayload`, `publishSnapshot` and `fetch` in `js/nostr/watchHistory.js`.
Updates tests to reflect the new single-event behavior.
2026-01-04 21:19:41 +00:00
thePR0M3TH3AN 849f0badd6 Merge pull request #1067 from PR0M3TH3AN/codex/remove-chunkwatchhistorypayloaditems-function
Refactor watch history payload building
2026-01-03 13:57:58 -05:00