Repository navigation
Delete core code the native app never runs - #189
Merged
Merged
Conversation
Leftovers from the web app, each confirmed unused by production code on current feat/expo-native: - The redirect OAuth flow: connectWithRedirect, completeRedirect, the redirect, redirectHandoff and native deps and state, buildAuthorizeUrl, exchangeCodeForToken, the Trakt site base they alone used, and the RedirectHandoff port. The app signs in only by device code and passed no-op stubs for all of these. - The TraktClient browser flag and the unreadable-response failure kind it alone produced. The app always passed browser: false. - parseLibrarySearch and LibrarySearch. - routeMovieUnmark and MovieUnmarkRoute, replaced by the durable queue lookup in useMovieActions. - performance.d.ts, whose rnStartupTiming nothing reads. The mock Trakt test that exchanged an authorization code to get a token for its refresh and revoke checks now gets the token from a device grant. The data tree changed, so the persisted-cache buster is bumped.
None of the deleted types is reachable from the data of a persisted query, so no persisted shape changed and shipping users keep their cache. The buster stays at 435347de5bc1; only the witness moves.
Pull request footprint
User-delivered artifact sizes
Most complex product function
|
arun279
commented
Oct 22, 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.
Part of the retroactive cleanup of #24: the "Core dead code left from the web app" set from the 2026-10-21 cleanup audit, re-checked against current
feat/expo-native(7f796a4) before deleting anything.Re-verification
All five items still exist and are still unused by production code. I checked each with
git grepoverpackages/,scripts/and.maestro.knipdoesn't flag any of them, because it counts the core tests as entry points, andknip --productionlists dozens of core exports the app does use (for exampleparseHistorySearch), so neither result settles anything here. The grep does. Nothing was already gone. Nothing had gained a caller._layout.tsxstill passesredirect: () => {}, a no-opredirectHandoffandnative: true, and nothing readsnative.browserflag andunreadable-response_layout.tsxstill passesbrowser: false, andclient.tsis still the kind's only producer.parseLibrarySearch,LibrarySearchrouteMovieUnmark,MovieUnmarkRouteuseMovieActions.tsusesresolveMovieUnmarkand the durable queue's pending ops.performance.d.tsrnStartupTiming.The audit's overlap with #159 no longer applies, because #159 merged.
Deleted, and what covers the behaviour that stays
connectWithRedirect,completeRedirect, theredirect,redirectHandoffandnativedeps and state,buildAuthorizeUrl,exchangeCodeForToken, theRedirectHandoffport, andsiteBaseUrlwithTRAKT_SITE_BASE, which onlybuildAuthorizeUrlused.redirectUristays, because Trakt's refresh grant needs it.create-auth-store.test.ts. "connects as soon as Trakt approves, while the Keychain is still saving the token" covers the Keychain race that the deleted redirect test also covered.auth-oauth.test.ts.browserandunreadable-response. Deleted fromTraktClient,boot.ts,create-runtime.ts,sync-contract.tsanddiagnostics.ts. A rejected fetch is now alwaysnetwork, and an abort is stilltimeout. Covered bytrakt-client.test.ts's "maps a fetch reject (no response) to network" and "rejects a held read as a typed timeout after the request timeout".sync-contract.test.tskeeps the server-failure copy check.parseLibrarySearch. Pure dead code.routeMovieUnmark. Its replacement is covered bymovie-detail.test.tsx's "cancels a deferred mark after remount without reading live plays" and "does not send an item removal while a mark is in flight".performance.d.ts. Pure dead code.Parallel mechanisms left alone
The mock's web PKCE authorize page, its authorization-code grant, and the CORS block stay. The audit marks them as waiting on #157, #161 and #164, and those closed without merging, so that decision is still open. "redirects the authorize page back to the app with the caller's state intact" stays. Nothing here touches the Trakt fakes, the menus or the privacy policy copies.
Persisted cache
The witness is reseeded, not bumped: the buster stays at
435347de5bc1, so shipping users keep their cache.shouldDehydrateQuerypersists thelibrary,movie-library,watchlist,users,history,calendarandgenresheads, plusshow/infofor library shows. It persists any query that has data. TanStack copies the whole query state, so a failed refetch's error can be stored too.restorableCacheclears the error on restored error-status queries, and the app reads failures only throughreadFailureOf'sinstanceof TraktReadError, which a restored plain object never passes. The app never producedunreadable-responseanyway, since it always passedbrowser: false.queryFndata of every persisted query factory. It found none ofAuthState,AuthDeps,RedirectHandoff,TraktFailureor itsunreadable-responsemember,TraktClientConfig,LibrarySearchorMovieUnmarkRoute. Two controls ran in the same check: a library entry nested in that data, and each deleted type planted into it. The walk found every one.Footprint
Product-Growth: none. Product code in
packages/core/src,packages/native/srcandpackages/native/appshrinks by 136 lines (6 added, 142 deleted), and tests by 208 lines (11 added, 219 deleted).Binary-Size: the Hermes bundles shrink 4,975 B on iOS (5,448,542 to 5,443,567) and 5,027 B on Android (5,480,582 to 5,475,555). I measured both with
expo exportandscripts/measure-sizes.sh, the way the check job does, on 7f796a4 and on this branch.pnpm checkpasses on Node 22.23.4.