Skip to content

Feature/backend api fixes - #109

Open
SugeethJSA wants to merge 3 commits into
lugvitc:masterfrom
SugeethJSA:feature/backend-api-fixes
Open

Feature/backend api fixes#109
SugeethJSA wants to merge 3 commits into
lugvitc:masterfrom
SugeethJSA:feature/backend-api-fixes

Conversation

@SugeethJSA

Copy link
Copy Markdown

enhance contact handling with phone number validation and logging

@celestix

Copy link
Copy Markdown
Collaborator

Required changes — release blocker

Reviewed head: 1f9ae5c4f793f25cbc5aea2ced928d10425316fb.

  • api/api.go:145,565-566: 🔴 Full sync enables per-contact app-state events, producing N Wails events, timers, and full frontend refreshes. Suppress incremental events for FromFullSync and emit one coalesced completion event.
  • api/contact.go:61-68: 🔴 Drops all LID/hosted contacts, causing valid contacts and names to disappear. Resolve LID→PN, validate/deduplicate aliases, and merge the richest record rather than filtering by server.
  • api/chat.go:121-138: 🔴 Chat lookup does not canonicalize LID identities and can format an opaque LID as a phone number. Use one canonical identity helper for lookup/display, format only default-server phone JIDs, and retain the original chat JID for navigation.
  • contact refresh path: 🟡 Performs a full GetAllContacts scan for logging and triggers full refreshes for each push/business-name update. Remove diagnostic full scans and coalesce refreshes.
  • fetch logging: 🟡 Logs success after a failed fetch. Return/record the error and emit success only after persistence completes.
  • tests: 🔴 No tests were added for LID→PN resolution, alias merging, full-sync event counts, duplicate identities, unknown contacts, or chat display/navigation. Add table-driven identity tests plus an integration test asserting exactly one frontend refresh for a full snapshot.

This PR has no dependency-policy violation, but the contact-loss and fan-out behavior must be corrected before merge.

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