Skip to content

fix: remove broken cherry-pick artifacts that prevent compilation#659

Merged
torlando-tech merged 2 commits intorelease/v0.9.xfrom
fix/broken-cherry-pick-cleanup-v0.9.x
Mar 11, 2026
Merged

fix: remove broken cherry-pick artifacts that prevent compilation#659
torlando-tech merged 2 commits intorelease/v0.9.xfrom
fix/broken-cherry-pick-cleanup-v0.9.x

Conversation

@torlando-tech
Copy link
Copy Markdown
Owner

Summary

  • Commit ae1cbd26b (sort messages by received time) was cherry-picked from main to the release branch but carried along changes that reference code only on main
  • SettingsScreen.kt: Removed DisposableEffect lifecycle observer and MessageDeliveryRetrievalCard parameters for background location permission flow (hasForegroundPermission, hasBackgroundPermission, showBackgroundLocationSheet, Toast, Settings) — none of which exist on this branch
  • MessagingViewModel.kt + 2 test files: Removed unused ReceivedLocationRepository import (class doesn't exist on this branch)
  • This broke the v0.9.19-beta tagged release build (run)

Test plan

  • compileNoSentryDebugKotlin passes (was failing before)
  • MapViewModelTest, SettingsViewModelTest, MessagingViewModelTest, MessagingViewModelImageLoadingTest all pass
  • Tagged release build should succeed after merge

🤖 Generated with Claude Code

Commit ae1cbd2 (sort messages by received time) was cherry-picked from
main but carried along changes referencing code not on this branch:

- SettingsScreen.kt: DisposableEffect lifecycle observer and
  MessageDeliveryRetrievalCard params for background location permission
  flow (hasForegroundPermission, hasBackgroundPermission, Toast, Settings)
- MessagingViewModel.kt: unused ReceivedLocationRepository import
- Test files: same unused import

These references cause compilation failures on the release branch,
which broke the v0.9.19-beta tagged release build.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 11, 2026

Greptile Summary

This PR removes cherry-pick artifacts from commit ae1cbd26b that broke compilation on the release/v0.9.x branch by referencing symbols (ReceivedLocationRepository, DisposableEffect + background-location permission state/params) that only exist on main. Additionally it corrects a pre-existing incorrect test assertion in test_wrapper_reactions.py that was asserting the wrong post-callback state of pending_inbound.

Key changes:

  • SettingsScreen.kt: Removes the DisposableEffect lifecycle observer (which referenced hasForegroundPermission / hasBackgroundPermission via the main-only LocationPermissionManager.hasBackgroundLocationPermission) and the three background-location-permission parameters passed to MessageDeliveryRetrievalCard. All associated state variables are fully eliminated; no orphaned declarations or stale imports remain.
  • MessagingViewModel.kt + 2 test files: Drops the unused import com.lxmf.messenger.data.repository.ReceivedLocationRepository that was dragged in by the cherry-pick but is absent on this branch.
  • python/test_wrapper_reactions.py: Fixes test_on_lxmf_delivery_regular_message_not_treated_as_reaction to accurately reflect the real _on_lxmf_delivery flow — pre-populating pending_inbound before the callback fires, preventing MagicMock attribute pollution on _columba_rssi/_columba_snr, and asserting len == 0 (message is removed after successful callback) instead of the previously wrong len == 1.

Confidence Score: 5/5

  • This PR is safe to merge — it removes dead/broken code introduced by a mis-targeted cherry-pick and fixes a corresponding test assertion.
  • All changes are purely subtractive: they remove code that was never meant to land on this branch and fix an incorrect test expectation to match already-shipping production behaviour. No new logic is introduced, no API surface changes, and the PR description documents that compileNoSentryDebugKotlin and all four ViewModel test suites pass.
  • No files require special attention; python/test_wrapper_reactions.py deserves a quick read to confirm the new test assertion matches the production _on_lxmf_delivery removal logic, but it does.

Important Files Changed

Filename Overview
app/src/main/java/com/lxmf/messenger/ui/screens/SettingsScreen.kt Removes the cherry-picked DisposableEffect lifecycle observer and three background-location-permission parameters from MessageDeliveryRetrievalCard. All stale state variables (hasForegroundPermission, hasBackgroundPermission, showBackgroundLocationSheet) are fully eliminated; remaining imports (LocalLifecycleOwner, Intent, Uri) are still actively used.
app/src/main/java/com/lxmf/messenger/viewmodel/MessagingViewModel.kt Removes the unused ReceivedLocationRepository import that was pulled in by the cherry-pick but does not exist on this release branch. Single-line, low-risk change.
app/src/test/java/com/lxmf/messenger/viewmodel/MessagingViewModelImageLoadingTest.kt Removes the unused ReceivedLocationRepository import, mirroring the same fix made to the production MessagingViewModel.
app/src/test/java/com/lxmf/messenger/viewmodel/MessagingViewModelTest.kt Removes the unused ReceivedLocationRepository import, same as MessagingViewModelImageLoadingTest.
python/test_wrapper_reactions.py Corrects test_on_lxmf_delivery_regular_message_not_treated_as_reaction to accurately model _on_lxmf_delivery behaviour: pre-populates pending_inbound with the message (as the real LXMF router does before the callback fires), pins _columba_rssi/_columba_snr to None to stop MagicMock auto-attribute creation from polluting add_signal_to_message_event, and changes the final assertion from length-1 (was wrong) to length-0 (message is removed after a successful callback).

Sequence Diagram

sequenceDiagram
    participant LR as LXMF Router
    participant RW as ReticulumWrapper._on_lxmf_delivery
    participant PI as router.pending_inbound
    participant KC as kotlin_message_received_callback

    LR->>PI: append(lxmf_message)
    LR->>RW: callback fires
    RW->>PI: check: message already in queue? (skip re-add)
    RW->>KC: invoke with full message event
    KC-->>RW: success
    RW->>PI: remove(lxmf_message)
    Note over PI: queue length 0 after successful delivery
Loading

Last reviewed commit: 4c853c3

Same fix as 1a3a694 applied to test_wrapper_messaging.py — the
reaction test needs the same treatment. The release branch removes
messages from pending_inbound after successful callback (e00d2a3),
so the test must pre-populate the queue and assert it's empty after.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sentry
Copy link
Copy Markdown
Contributor

sentry bot commented Mar 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@torlando-tech torlando-tech merged commit 14eb883 into release/v0.9.x Mar 11, 2026
14 checks passed
@torlando-tech torlando-tech deleted the fix/broken-cherry-pick-cleanup-v0.9.x branch March 11, 2026 15:23
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.

1 participant