Repository navigation
Fix orangetv.orange.es segment cache leaking programs across channels - #3274
Merged
PopeyeTheSai10r merged 3 commits intoOct 23, 2026
Merged
Conversation
The cache stored segment items AFTER filtering them for whichever channel fetched the segment first, so every channel parsed afterwards on the same date inherited that channel's segment 2-3 programs (e.g. TRECE's evening show appearing on ~100 other channels). Cache the raw segment payload instead and filter per channel. Also fetch segments 2-3 even when segment 1 has no items (channels idle between 00:00-08:00 came out empty), and compare channel ids as strings since the feed mixes numeric and string channelExternalId.
freearhey
approved these changes
Oct 23, 2026
PopeyeTheSai10r
enabled auto-merge
October 23, 2026 13:59
PopeyeTheSai10r
approved these changes
Oct 23, 2026
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
sites/orangetv.orange.es/orangetv.orange.es.config.jsfetches each day in three 8-hour segments and caches segments 2-3 in a module-levelcachesobject. But it stores the items after filtering them for the channel that happened to fetch the segment first:Every channel parsed afterwards for the same date does
items.push(...caches[url])and inherits that first channel's segment 2-3 programs. In a multi-channel grab this puts the same show on ~100 channels (screenshot below shows TRECE's "El cascabel" appearing on virtually every channel at 22:00):Two smaller issues fixed along the way:
if (items.length)guard skipped segments 2-3 whenever a channel had no programs in segment 1 (00:00-08:00), so channels idle overnight came out completely empty even though the feed has their programs in segments 2-3.i.channelExternalId === channel.site_idcompares strictly while the feed mixes numeric and string ids; compare as strings.Fix
Cache the raw segment payload and run
parseItemsper channel; always fetch segments 2-3; compare ids as strings.Testing
npm test --- orangetv.orange.espasses (3/3)