arskom / cekirge

Chatbot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Message storage format

plq opened this issue · comments

WhatsApp Messages have;

  • A body
  • Zero or more attachments
  • Attachments that are stickers ???

WhatsApp messages may arrive;

  • Directly (DM)
  • From a group (GM)
  • Status updates (SU) ???

Details:

  • Header values for the DM type:

    • From: Address value comes from message.from. Name comes from the latest SU
    • To: Address value comes from message.to. Name is empty
  • Header values for the GM type:

    • From: Address value comes from message.from. Name comes from the latest SU
    • To: Address value comes from message.to which contains the group id. Name comes from the group name
    • Author (RFC 9057): Address value comes from message.author which contains the group id. Name comes from the latest SU
    • List-Id: Contains the message.to value.

#4 DONE.

Fixed race condition due to forgotten await.

You are inserting then issuing multiple(?) updates. You should perform a single insert, please fix these as well.

Also, we need;

  1. Dummy data, in order to avoid launching the browser instrumentation every time
  2. Tests.

System now uses single insert function.