Edge: resume on the same clip after switching tabs, creator pages load all clips from RedGifs #3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "girlyoulookthebest/goon:fix/edge-seen-and-creator"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
wo fixes for Edge, plus a changelog entry. Three commits on top of
8491f38, plus a merge of current main (0de28b2) that resolves a changelog conflict. Fix 1 is app-only (JavaScript, can go out as OTA). Fix 2 needs the backend deployed; the app side of it is JavaScript as well. No native changes, no migrations, no new dependencies.1. Coming back to Edge no longer replays clips you already watched (
fd8aa5d,e77bd60)Edge unmounts whenever you switch to another tab (it holds the video players). On the way back it started at seedKey 0 and clip 0, while the pages from the previous visit were still in the react-query cache (
staleTime: Infinity, default 5 min gc). So within 5 minutes of leaving, Edge replayed everything already watched from the first clip; after that the cache was gone and the server sent new clips, which is why it only happened sometimes. The server's seen-tracking was fine: across 5 pages and a fresh deal, no clip id came back.Edge now remembers its place between mounts (module-level
seedKey, filter and index) and resumes on the clip you left while those pages are cached; the feed cache is kept 30 min. If the pages are gone, it gets a new deal from the server. The pager mounts only after the Edge prefs are loaded (prefsReady): the cached pages are available on the first render, one render before the prefs, and a pager mounted then started on page 0 and pulled Edge back to the first clip.Touches:
screens/SwipeScreen.tsx.2. A creator's page loads their clips from RedGifs (
fd8aa5d)GET /clips?creator=only listed what ingest had happened to catch (hourly "latest" plus the niche backfill), often a small part of the account: one creator had 2 clips locally out of 225 on RedGifs, another has 11,222 on RedGifs.RedgifsClient.user_gifsexisted but nothing called it.The first page request for a creator now starts a background sync from
/v2/users/<name>/search(newest first, up to 20 pages = 2,000 clips) and waits at most 4 s for the first page; the response sayssyncing: truewhile more is coming. A repeat visit after 6 h syncs again and stops at the first page with nothing new. Syncs run one at a time on a single worker thread (RedGifs rate limits per IP), with at most 8 waiting; state is in-process, which fits the single API replica.GOON_CLIPS_CREATOR_SYNC=falseturns it off. The app polls every 3 s whilesyncing, but not while a clip is playing from the grid, since newer clips land above the current one and would shift the pager; items are de-duplicated by id because pages shift as clips arrive.Touches:
app/api/clips.py,app/scheduler/clips_ingest.py(sync_creator),app/connectors/clips/redgifs.py(user name is URL-encoded,PAGE_MAX),app/config.py,mobile/src/screens/ClipCreatorScreen.tsx,mobile/src/types.ts, newtests/test_creator_sync_20261126.py.Changelog: one new entry,
2026-11-27b, with a line per fix, above Jan's2026-11-27a(movie ratings), which is unchanged (c219b20, merge76dddac).Testing: Android 15 emulator against a local backend built from this branch, with about 4,200 real RedGifs clips imported. Fix 1: checked by hand (scroll, switch to Scenes, back to Edge: same clip) and through the app's own feed events and debug logs (left on clip 3, came back on clip 3, no page 0 reported). Fix 2: against the local API, a creator with 2 clips locally returned 100 after about 1 s with
syncing: true, then all 225 a few seconds later;sync_creatorrun live against RedGifs fetched all 137 clips of another creator in 2 pages. Not tried on a physical phone, and fix 2 has not been tested in the app on the emulator yet.12 new backend tests pass. The full suite has the same 3 failures as main here (they need
STREAM_PROXY_SECRET), and ruff reports the same 11 existing warnings in the touched files. The app typecheck shows the same 7 errors as main, none new.Edge: resume on the same clip after switching tabs, creator pages load all clips from RedGifsto WIP: Edge: resume on the same clip after switching tabs, creator pages load all clips from RedGifsWIP: Edge: resume on the same clip after switching tabs, creator pages load all clips from RedGifsto Edge: resume on the same clip after switching tabs, creator pages load all clips from RedGifsView command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.