fix: preserve episode created_at ordering + increase query limit#54
Merged
Conversation
Root cause: sync script bumped all episode created_at to now(), making all 23 episodes share the same timestamp. Relays return only 15 events per query, so real episodes got randomly excluded. Changes: - sync-episodes-to-relays.ts: use original_created_at + 1 instead of max(original+1, now()) to preserve chronological ordering - usePodcastEpisodes.ts: increase infinite scroll query limit to Math.max(limit+5, 50) to fetch all episodes including hidden ones - usePodcastEpisodes.ts: replace any types with proper NostrFilter type
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Episodes page shows incomplete results — May 6 episode missing despite showing on homepage.
Root Cause
The sync script (
sync-episodes-to-relays.ts) bumped all episodecreated_attimestamps tonow():This made all 23 episodes share the same timestamp. Relays return only 15 events per query (the
limit), so with identical timestamps the relay picks arbitrarily — real episodes get randomly excluded.Changes
scripts/sync-episodes-to-relays.ts: Usecreated_at + 1instead ofmax(created_at + 1, now())to preserve original chronological orderingsrc/hooks/usePodcastEpisodes.ts: Increase infinite scroll fetch limit toMath.max(limit + 5, 50)to fetch all episodes even when many hidden/test episodes existsrc/hooks/usePodcastEpisodes.ts: Replaceanytypes with properNostrFiltertype