Mobile-emulator / communication_sync.md
h0kzdbvj
Improve virtual phone number generation and link communication apps
8a6ddd2

Phone and Messages Synchronization

The Phone and Messages apps have been unified to use a single virtual phone number per user.

Synchronization Logic

  • Single Source of Truth: The lun_numbers table is now the primary source for a user's phone identity.
  • Bi-directional Linking:
    • If a user creates a number in the Phone app, it is automatically assigned to their primary Virtual SIM used by Messages.
    • If a user provisions a Virtual SIM in the Messages app, it automatically creates the corresponding LunNumber record for the Phone app.
  • Persistence: Numbers are tied to the user_id, ensuring they remain identical across logins and across all communication apps.

Database Tables

  • lun_numbers: Stores the official identity number for the user.
  • virtual_sims: Stores the SIM card details, with the lun_number field synchronized to the lun_numbers table.