Skip to content

cleanup: remove unreferenced declarations on both platforms - #2617

Merged
ryanbr merged 2 commits into
ryanbr:mainfrom
UtkuDenizAltiok:dead-code-2
Oct 2, 2026
Merged

ryanbr merged 2 commits into
ryanbr:mainfrom
UtkuDenizAltiok:dead-code-2

Conversation

@UtkuDenizAltiok

Copy link
Copy Markdown

What this PR does

Removes declarations that nothing calls, on both platforms: 15 in Swift and 5 in Kotlin, 93 lines, no behaviour change. A follow-up to #2417.

How each was chosen. On 7f396e98, a whole-word search over every Swift and Kotlin file (app, packages, widgets, watch, tests) finds each name only at its own declaration. None implements a protocol requirement, framework callback or App Intent. For each, the job is either done elsewhere or no longer exists:

removed why it is safe
BLEManager.uploadTimer + uploadIntervalSeconds never scheduled, only cancelled; its comment describes uploading to a server NOOP does not have
HealthKitBridge.foregroundCatchUp the app-active hook runs health.sync() (30 days) through HealthSyncRefreshCoordinator instead
CoachBriefScheduler.widgetBriefText / widgetBriefDate the widget reads the App Group keys itself (CoachBriefWidget)
aiCoachPrivacyNote CoachView / CoachLauncherSheet carry their own privacy text
SleepView.napMaxHours; Kotlin SleepSession.isNapShaped + NAP_MAX_HOURS + durationHours naps are "not the main block" on both platforms since #518/#547; the duration rule was read by nothing on either side. durationHours is computed, not a column, so the schema is unchanged
ImuSessionFileStore.prepareForRead (both) callers use flushSession / deleteFiles
RepositoryFreshness.hasAnyHistory / Kotlin DataFreshness.hasAnyHistory unread on both
Collector.bufferedCount, BiofeedbackPrefs.clearLockedPace, BatteryGuidedCapture.currentStatus, Profile.avatarImage, JournalCatalog.setSortIndex, SkinTempBackfillWalker totalAttempted unread; what they wrapped (statusText, Image(platformImage:), sortIndex, …) stays in use

Kept on purpose, although nothing calls them today: NavRouter.openTrends / openLiveSession and BehaviorStore.didRecalibrateCharge, because their comments name the surface they are waiting for. Repository.allowSleepReDetection / dismissedSleepManagementWindows stay because Android's UI uses its twins and iOS has no screen for them yet. BiofeedbackPrefs.useResonancePace stays too: the setting is read by nothing today, which is a bug fixed in a separate PR rather than code to delete.

Type of change

  • Refactor / cleanup (no behaviour change)

How it was tested

  • Full local run on 4d3e6c89 (on 7f396e98): WhoopStore 631 · StrandAnalytics 2102 · StrandImport 327 · doc lint · i18n · parity ledger · parity ratchet · parity governance 127 · macOS StrandTests 2,254 (only the two locale-dependent TodayCarryOverTests) · iOS build.
  • Parity: removing the nap constant pair moved the derived inventory, refreshed in the second commit with parity_ledger.py --refresh-derived --base upstream/main. Unpaired properties went 165 → 162 and unpaired constants 598 → 597.
  • Android CI on the fork (assembleFullDebug + testFullDebugUnitTest): green on 4d3e6c89 (run 36796672883).
  • After the edit, the same search finds no remaining reference to any removed name anywhere in the repository, docs included.

Checklist

  • No new build warnings introduced
  • Follows the conventions in docs/CONTRIBUTING.md
  • I did not commit generated output (Strand.xcodeproj/) or any secrets/keystores

Related issues

Refs #2417

🤖 Generated with Claude Code

UtkuDenizAltiok and others added 2 commits October 1, 2026 02:01
Each was checked on 7f396e9 by whole-word search over every Swift and Kotlin
file (app, packages, widgets, tests): its own declaration is its only
occurrence, it implements no protocol requirement, framework callback or
App Intent, and its job is done elsewhere or no longer exists.

Swift: Collector.bufferedCount, ImuSessionFileStore.prepareForRead,
BLEManager.uploadTimer + uploadIntervalSeconds (never scheduled, only
cancelled; it uploaded to a server NOOP does not have),
BiofeedbackPrefs.clearLockedPace, SleepView.napMaxHours (naps are "not the
main block" since ryanbr#518/ryanbr#547), BatteryGuidedCapture.currentStatus,
CoachBriefScheduler.widgetBriefText/widgetBriefDate (the widget reads the App
Group keys itself), aiCoachPrivacyNote (the coach screens carry their own
privacy text), Profile.avatarImage, RepositoryFreshness.hasAnyHistory,
JournalCatalog.setSortIndex, SkinTempBackfillWalker totalAttempted,
HealthKitBridge.foregroundCatchUp (the app-active hook runs health.sync()
over 30 days instead).

Kotlin twins that are equally unused: ImuSessionFileStore.prepareForRead,
DataFreshness.hasAnyHistory, SleepSession.isNapShaped with its
NAP_MAX_HOURS and durationHours (computed, no column; no schema change).

Kept although unreferenced: NavRouter.openTrends/openLiveSession and
BehaviorStore.didRecalibrateCharge (hooks their comments name a surface for),
Repository.allowSleepReDetection/dismissedSleepManagementWindows (Android's
UI uses them; iOS lacks the screen), BiofeedbackPrefs.useResonancePace (the
setting is ignored today, a separate fix).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Produced by `parity_ledger.py --refresh-derived --base upstream/main`: three
properties and one constant fewer, all of them unpaired.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
UtkuDenizAltiok added a commit to UtkuDenizAltiok/noop that referenced this pull request Oct 1, 2026
…b998c shipped, REM/memory/sweep findings, history scrub
UtkuDenizAltiok added a commit to UtkuDenizAltiok/noop that referenced this pull request Oct 1, 2026
…b998c shipped, REM/memory/sweep findings, history scrub
@ryanbr
ryanbr merged commit 257c4eb into ryanbr:main Oct 2, 2026
7 checks passed
@UtkuDenizAltiok
UtkuDenizAltiok deleted the dead-code-2 branch October 3, 2026 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants