Skip to content

Reuse Fuse instance for episode search - #149

Merged
chhoumann merged 1 commit into
masterfrom
reuse-fuse-instance
Nov 24, 2025
Merged

chhoumann merged 1 commit into
masterfrom
reuse-fuse-instance

Conversation

@chhoumann

Copy link
Copy Markdown
Owner

Summary:\n- memoize Fuse instances per episode list to avoid rebuilding on each query\n- refresh cached index when the list size changes

@vercel

vercel Bot commented Nov 24, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
podnotes Ignored Ignored Nov 24, 2025 6:27am

@chhoumann
chhoumann merged commit 29d3aa4 into master Nov 24, 2025
3 checks passed
@chhoumann
chhoumann deleted the reuse-fuse-instance branch November 24, 2025 06:54
chhoumann added a commit that referenced this pull request Nov 24, 2025
chhoumann added a commit that referenced this pull request Nov 24, 2025
* feat: Add transcription queue for episodes (#132)

* feat: Add volume control to player (#133)

* fix: mount views with svelte api (#134)

* fix: Reserve image space and use native lazy load (#138)

* Reserve image space and use native lazy load

* Fix image loading attribute type

* fix: fix Obsidian listener accumulation (#141)

* feaet: Optimize latest episodes aggregation (#142)

* fix: Add keys to podcast lists (#136)

* fix: Stabilize episode list layout (#139)

* style: move inline podcast styles into CSS (#145)

* fix: persist hide-played toggle (#144)

* feat: Optimize latest episodes updates (#143)

* refactor: Remove redundant currentTime sync (#147)

* fix: Replace moment date formatting in episode list (#148)

* feat: Stream feed loading in PodcastView (#140)

* Improve podcast feed initial loading

* Guard feed search before cache ready

* fix: Optimize Fuse reuse in search (#149)

* feat: Improve topbar focus contrast (#150)

* feat: Add live input handling for episode search (#135)

* fix: Use Intl formatter for episode dates (#153)

* feat: Improve nav cues and native lazy images (#152)

* feat: Improve podcast loading feedback (#151)

* fix: guard obsidian inputs from feedback loops (#154)

* fix: settings corruption
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 2.15.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

chhoumann added a commit that referenced this pull request Jun 29, 2026
* fix(feed): parse the feed once per getEpisodes call

getEpisodes fetched and parsed the feed twice on a cold call: once via
getFeed (to populate channel metadata) and again directly to read the
items. This doubled the network round-trips and XML parses on every cold
path, e.g. the URIHandler resume-link flow that constructs a FeedParser
with no cached feed.

Fetch and parse the document a single time and reuse it for both the
channel metadata and the episode items. The metadata extraction moves to
a private extractFeed(body, url) helper that getFeed and getEpisodes both
call, so behavior (metadata population, the "Invalid RSS feed" guard,
this.feed caching) is unchanged - only the redundant second fetch is
removed.

Resolves deepsec finding other-redundant-fetch.

* fix(search): rebuild the Fuse cache on content change, not just length

The Fuse search index was cached in a WeakMap keyed by the episodes array
and reused whenever the cached size matched the array length. Length is a
weak fingerprint: the same array reference mutated in place at the same
length (an entry swapped or edited) would return the stale index built
from the old contents.

Validate the cache with a content signature (a JSON-framed list of each
episode's title and streamUrl) instead of length, so any content or
ordering change rebuilds the index while an unchanged list keeps reusing
it across keystrokes (preserving the #149 optimization). Adds the first
unit tests for searchEpisodes, including a Fuse-construction spy proving
the index is reused when unchanged and rebuilt when the content changes.

Resolves deepsec finding other-stale-cache.
github-actions Bot pushed a commit that referenced this pull request Jul 9, 2026
## [2.17.3](2.17.2...2.17.3) (2026-07-09)

### Bug Fixes

* **feed/search:** parse feed once + content-based search cache ([#225](#225)) ([053d51f](053d51f)), closes [#149](#149)
* make episode identity key collision-resistant and prototype-safe ([#226](#226)) ([a5683db](a5683db))
* **opml:** correct import progress math and saved-count reporting ([#221](#221)) ([a79e529](a79e529))
* **security:** validate feed/URI URLs and cap download size ([#223](#223)) ([edef281](edef281))
* **template:** neutralize feed-controlled note injection ([#228](#228)) ([ef4ecbd](ef4ecbd))
* **timestamp:** escape live table-cell pipe after an escaped backslash ([#227](#227)) ([a34dfca](a34dfca))
* **transcription:** resolve three deepsec transcription-pipeline bugs ([#224](#224)) ([83c34e7](83c34e7))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant