Skip to content

Fix iOS QR contact send path resolution - #134

Merged
torlando-tech merged 9 commits into
mainfrom
fix/ios-qr-python-send-path-pr
Aug 3, 2026
Merged

Fix iOS QR contact send path resolution#134
torlando-tech merged 9 commits into
mainfrom
fix/ios-qr-python-send-path-pr

Conversation

@torlando-tech

Copy link
Copy Markdown
Owner

Summary

  • generate lxma:// QR codes from the LXMF delivery destination instead of the identity hash
  • validate that an imported public key cryptographically owns the claimed lxmf.delivery destination
  • retain verified peer identities in the shipping Python runtime without requesting a path while browsing or importing contacts
  • request and boundedly await missing paths only when sending messages or reactions, using a dedicated bridge executor
  • persist actionable failed-send state and retry the complete message payload without deleting the only durable row first

Scope

This change targets the shipping embedded-Python RNS/LXMF runtime only. It does not change Model B, the Network Extension, Proxy IPC, App Group outbox behavior, or LXMF-swift dependencies.

Verification

  • python3 -m unittest Tests.static.test_qr_contact_send_path_contract -v - 14 passed
  • python3 -m unittest discover -s Tests/static -p 'test_*.py' - 221 passed, 1 skipped
  • python3 -m py_compile app/rns_bridge.py - passed
  • shipping xcodebuild test on iPhone 17 simulator - 156 passed
  • git diff --check origin/main...HEAD - passed

The automated tests cover QR destination binding, Python identity retention, bounded one-request path resolution, passive contact behavior, actionable send failures, and payload-preserving retry. Real camera focus, metadata recognition, vibration, scanner dismissal, and Add Contact presentation still require physical-device verification.

@greptile-apps

greptile-apps Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This revision fixes the previously reported retry-persistence failures by staging retries durably, atomically rekeying their database rows, and recovering interrupted attempts into an actionable uncertain-delivery state.

  • Adds transactional retry staging and replacement through GRDB.
  • Restores interrupted staged retries as visible failures during startup.
  • Preserves complete message payloads when retrying.
  • Moves QR contacts to verified LXMF delivery destinations and resolves missing paths only during sends.

Confidence Score: 5/5

The PR appears safe to merge.

The previously reported retry replacement and interrupted-retry failures are addressed: row transitions are transactional, staged attempts are recovered as visible uncertain failures, and no blocking failure remains.

Important Files Changed

Filename Overview
Sources/ColumbaApp/ViewModels/MessagingViewModel.swift Retry now stages the existing durable row, resends the complete payload, and records either the canonical sent state or an actionable failure.
Sources/ColumbaApp/Services/MessageRepository.swift Adds transactional retry rekeying, compare-and-set staging, and startup recovery for interrupted app-owned retries.
Sources/ColumbaApp/Services/AppServices.swift Runs interrupted-retry recovery whenever the per-identity message repository is initialized.
Sources/RNSBackendPy/PythonRNSBackend.swift Restricts bounded path resolution to non-propagated message and reaction sends.
Sources/PythonBridge/PythonBridge.swift Adds dedicated bridge operations for retaining verified identities and resolving paths without blocking unrelated bridge work.
app/rns_bridge.py Implements identity retention and bounded path resolution for the shipping embedded-Python runtime.

Sequence Diagram

sequenceDiagram
    participant User
    participant VM as MessagingViewModel
    participant DB as MessageRepository
    participant Backend
    User->>VM: Retry failed message
    VM->>DB: stageRetry (failed → sending)
    DB-->>VM: Atomic row rekey
    VM->>Backend: Submit complete payload
    alt Backend accepts
        Backend-->>VM: queued(canonical hash)
        VM->>DB: Atomic replacement (sending → sent)
    else Submission fails
        Backend-->>VM: Failure
        VM->>DB: Replace staged row as failed
    else App terminates while staged
        VM-xBackend: Delivery outcome uncertain
        DB->>DB: Startup recovery (sending → failed/uncertain)
    end
Loading

Reviews (3): Last reviewed commit: "fix: persist direct delivery method" | Re-trigger Greptile

Comment thread Sources/ColumbaApp/ViewModels/MessagingViewModel.swift Outdated
Comment thread Sources/ColumbaApp/ViewModels/MessagingViewModel.swift Outdated
@torlando-tech
torlando-tech merged commit 1057b9e into main Aug 3, 2026
4 checks passed
@torlando-tech
torlando-tech deleted the fix/ios-qr-python-send-path-pr branch August 3, 2026 20:00
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