Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • (tick) Should entities be allowed to have more than one associated message thread? 
    • A:  Yes.  A "thread" is just a linked list of messages, linked by their inReplyTo reference, which is optional.  The ID of the thread is just the ID of the first message in the list, which has an empty 'inReplyTo' field.  So if more than one message is 'sent to' an entity (as part of a discussion forum) with an empty inReplyTo field, then there is more than one thread for the entity.
  • (error) Or message threads to have more than one associated entity?
  • (error) Should we allow messages to be sent to multiple non-principals at once?
  • Should messages with low numbers of recipients be processed in an immediately consistent manner?
    • (tick) Sending messages to non-principals (i.e. commenting on an entity) does not need asynchronous processing
    • (tick) Sending messages to a single recipient will be done transactionally
  • What ACCESS_TYPE should be associated with the ability to comment on an entity?
    • (tick) SEND_MESSAGE
  • What ACCESS_TYPE should be associated with the ability to message a user?
    • (tick) No restriction
    • (tick) Add a blacklist
    • (tick) Flag as inappropriate
  • Should the worker use SQS or RDS to manage the flow of messages to send?
    • (question) Proposed RDS implementation:
      • Add a migratable table with a single column of message IDs
      • Add a worker that periodically polls the table
      • If the table is not empty, process N rows from the top
      • Delete rows once finished processing
    • Using SQS opens up the possibility of losing messages (especially during weekend stack switching).  The state stored in SQS would not be migrated between stacks.  And unlike change messages, there is no trivial method to detect if a message has been changed.  And reusing the change messages is not possible, since retransmission of messages is incorrect behavior. 
  • How should we bounce messages?  Silently?  Via an auto-generated message?
    • (tick) Add services to check if message can be sent.  This way, the UI can check if a message can be sent before sending it.  
    • (question) On an error, send an error message to the sender's inbox.
  • How should we handle messages sent to groups rather than individuals?  Should the message be broken into individuals messages (after checking for SEND_MESSAGE permission on the group)?  
    • (question) Currently, it simply stashes the message, leaving no way of fetching the message (other than as a sender).  

Objects

 
NameDBO

DTO

 Message

MessageContent

(Immutable after creation)

Primary key: Message

ID

Foreign key: CreatedBy

(

UserGroup

PK)

  • RecipientType (Enum ObjectType)
  • Recipients (gzip-blob of longs)
  • Subject (nullable)
  • Foreign key:

    MessageBody (S3 File Handle ID)

    CreatedOn

    Foreign key: replyTo (Message ID) (nullable

    CreatedBy (FK to JDOUSERGROUP)

    InReplyTo (FK to ID column) (nullable)

    interface (superclass represented as JSON schema)

    • ID (derived from ID generator)
    • CreatedBy (principal ID) (upon creation filled in for the authenticated user)
    • RecipientBundle
      • List of recipient IDs
      Subject (string, optional)
    • S3 File Handle ID
    • CreatedOn
    • inReplyTo* (optional)

    MessageToUser

    (Immutable after creation)

    •  Message Thread Object
    • Primary key: Thread ID
    • Unique key: Thread ID, Object ID, Object type

    MessageContentID (FK to MessageContent)

    Subject (nullable)

    •  Message thread
    • Primary key: Message ID
    • Foreign key: Thread ID (is a Message ID)
      • Recursive foreign key to primary key
     

    implements MessageContent

    Subject (string, optional)

    MessageRecipient

    (Immutable after creation)

    FK to MessageToUser

    FK to JDOUSERGOUP

    n/a

    Comment

    (Immutable after creation)

    MessageContentID (FK to MessageContent)

    TargetType (Enum ObjectType)

    TargetID

    implements MessageContent

    MessageInReplyToRoot

    • Primary key: MessageContentID (FK to MessageContent)
    • Foreign key: InReplyToRootID
      • Recursive foreign key to primary key
    n/a
    •  Message votes
    • Primary key: Message ID
    • Up votes
    • Down votes
    • ID
    • Up
    • Down
    •  MessageStatus
    • Foreign key: Message ID
    • Foreign key: Recipient ID (UserGroup)
    • States: UNREAD, READ, ARCHIVED
    • ID
    • Recipient
    • State
    •  MessageSettings
    • Foreign key: User ID (UserGroup)
    • Etag
    • Blob of settings
    • ID
    • Notification levels
      • Update to an owned entity
      • Update to some favorite entity
      • Team
      • Message from user
      • Mail to everyone
      • Etc...
    • Message receipt email (if more than one)
    • Auto-mark mail as read if forwarded to email
    •  MessageBundle
     Bundles the Message and Message Status
    •  RecipientBundle
     
    • RecipientType
      • May be a principal, entity, ...
    • Array of IDs
      • All IDs must be valid (404 otherwise)

    ...