Skip to content

Conversation

@jackjackbits
Copy link
Collaborator

Remove unused functions, types, and properties that were never called:

  • MessageRateLimiter: remove reset()
  • MinimalDistancePalette: remove reset()
  • TransferProgressManager: remove reset(id:) and snapshot(id:)
  • MeshTopologyTracker: remove removePeer(_:)
  • GeohashParticipantTracker: remove clear() and clear(geohash:)
  • SyncTypeFlags: remove unused static properties and functions
  • NoiseEncryptionService: remove unused NoiseMessageType and NoiseMessage types
  • PrivateChatManager: remove write-only selectedPeerFingerprint property
  • AutocompleteService: remove commented code and unused command autocomplete logic

Remove unused functions, types, and properties that were never called:

- MessageRateLimiter: remove reset()
- MinimalDistancePalette: remove reset()
- TransferProgressManager: remove reset(id:) and snapshot(id:)
- MeshTopologyTracker: remove removePeer(_:)
- GeohashParticipantTracker: remove clear() and clear(geohash:)
- SyncTypeFlags: remove unused static properties and functions
- NoiseEncryptionService: remove unused NoiseMessageType and NoiseMessage types
- PrivateChatManager: remove write-only selectedPeerFingerprint property
- AutocompleteService: remove commented code and unused command autocomplete logic
Remove test cases that were testing functions removed in the previous commit:
- GeohashParticipantTrackerTests: remove clear() and clear(geohash:) tests
- MeshTopologyTrackerTests: remove removePeer() test
This private function was only called by toMessageTypes() which was
removed in the previous commit, leaving it as dead code.
These were incorrectly removed as dead code, but GossipSyncManager.swift
uses them via Swift's shorthand syntax (.fragment, .fileTransfer).
Swift 6 forbids calling NSLock.lock()/unlock() from async contexts.
Replace with serial DispatchQueue.sync which is async-safe.
@jackjackbits jackjackbits deleted the claude/find-dead-code-zgrMc branch January 24, 2026 01:26
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.

3 participants