Skip to content

Fix announced LXMF peer names on iOS - #137

Merged
torlando-tech merged 10 commits into
mainfrom
fix/ios-announced-peer-name
Aug 4, 2026
Merged

Fix announced LXMF peer names on iOS#137
torlando-tech merged 10 commits into
mainfrom
fix/ios-announced-peer-name

Conversation

@torlando-tech

Copy link
Copy Markdown
Owner

Summary

  • replace generated Peer <hash> conversation placeholders when an LXMF announce supplies the peer's display name
  • preserve custom nicknames and previously announced names
  • apply the name with one conditional database update so concurrent nickname edits cannot be overwritten
  • add unit and GRDB-backed regressions for placeholder replacement and custom-name preservation

Verification

  • focused GRDB/XCTest regressions: 2 passed
  • full Swift package suite: 34 passed
  • static contract suite: 223 passed, 1 skipped
  • shipping embedded-Python simulator build/test: passed
  • independent exact-head review: approved with no actionable findings

Risk and rollback

The update is limited to conversation rows whose display name is null, empty, or exactly the generated hash placeholder. Reverting this PR restores the previous behavior.

@greptile-apps

greptile-apps Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR now atomically replaces generated peer-name placeholders with announced LXMF display names while preserving custom names, and refreshes the visible conversation list after the committed metadata change.

  • Adds a conditional GRDB update for announced display names.
  • Posts and observes a conversation-metadata notification after successful updates.
  • Centralizes generated placeholder-name construction and classification.
  • Adds repository, parser, and visible-list regression coverage.

Confidence Score: 5/5

The PR appears safe to merge.

The previously reported stale-list issue is resolved by posting a metadata-change notification after the conditional database update completes and reloading the active ChatsViewModel from the committed store; no blocking failure remains.

Important Files Changed

Filename Overview
Sources/ColumbaApp/Services/AppServices.swift Routes non-empty LXMF announce names through the repository’s atomic placeholder-replacement operation.
Sources/ColumbaApp/Services/MessageRepository.swift Adds a conditional metadata update and posts the refresh notification only after the database write succeeds.
Sources/ColumbaApp/ViewModels/ChatsViewModel.swift Observes committed conversation metadata changes and reloads the generation-protected visible list.
Sources/RNSAPI/Util/AppDataParser.swift Centralizes deterministic conversation-placeholder generation and replacement classification.
Tests/ColumbaAppTests/AnnounceClassificationTests.swift Covers atomic placeholder replacement and preservation of current custom names.
Tests/ColumbaAppTests/MicronParserTests.swift Verifies that an announced display-name update refreshes an already-visible chat list.
Tests/RNSAPITests/AppDataParserTests.swift Covers empty, generated, case-insensitive generated, custom, and unrelated peer-like names.

Sequence Diagram

sequenceDiagram
    participant Peer as LXMF Peer
    participant Services as AppServices
    participant Repo as MessageRepository
    participant DB as GRDB
    participant VM as ChatsViewModel
    Peer->>Services: Announce with display name
    Services->>Repo: applyAnnouncedDisplayName(hash, name)
    Repo->>DB: Conditional UPDATE
    DB-->>Repo: One row updated
    Repo-->>VM: conversationMetadataChangedNotification
    VM->>Repo: loadConversations()
    Repo-->>VM: Conversation with announced name
Loading

Reviews (2): Last reviewed commit: "test: isolate announced name refresh sig..." | Re-trigger Greptile

Comment thread Sources/ColumbaApp/Services/AppServices.swift
@torlando-tech
torlando-tech merged commit 59bafbc into main Aug 4, 2026
4 checks passed
@torlando-tech
torlando-tech deleted the fix/ios-announced-peer-name branch August 4, 2026 00:41
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