-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Messages: Add new message fields to message spec #210
base: main
Are you sure you want to change the base?
Conversation
32a69df
to
151d71f
Compare
151d71f
to
ec04d4e
Compare
ec04d4e
to
bf88949
Compare
bf88949
to
cc0073d
Compare
textile/features.textile
Outdated
** @(TM2M)@ @refType@ string - if the @refSerial@ is set, this must be set. If describes the type of the reference. | ||
** @(TM2N)@ @updatedAt@ time in milliseconds since epoch. If a message received from Ably has the @action@ field set to "MESSAGE_UPDATE" then the @updatedAt@ field must be set to the time the message was updated. | ||
** @(TM2O)@ @deletedAt@ time in milliseconds since epoch. If a message received from Ably has the @action@ field set to "MESSAGE_DELETE" then the @deleteAt@ field must be set to the time the message was deleted. | ||
** @(TM2P)@ @operation@ operation is an JSON-encodable object that contains the following `optional` fields; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see why we'd need to make this a JsonObject. It's a well-defined optional substruct of the Message with three known fields, why shouldn't the library expose it accordingly? (In JS there might not be a difference (other than the typings), it could just be a plain object, but eg in java this would be much more usable as a MessageOperation class or whatever vs a JSONObject)
cc0073d
to
b25f641
Compare
…documentation - Added @action@ enum field in the message structure, which specifies the type of the message action. It includes a series of predefined actions (CREATE, UPDATE, DELETE, etc.). - Added additional fields `serial`, `refSerial`, `refType`, `updatedAt`, `deletedAt`, and `operation` to the Message data type. - Update the Message class to reflect the new members. - Added section on REST and Realtime publish that now requires the message action field to be set on publish.
b25f641
to
edaf89c
Compare
…documentation - Added @action@ enum field in the message structure, which specifies the type of the message action. It includes a series of predefined actions (CREATE, UPDATE, DELETE, etc.). - Added additional fields `serial`, `refSerial`, `refType`, `updatedAt`, `updateSerial`, and `operation` to the Message data type. - Update the Message class to reflect the new members.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a couple small further changes, but pre-approving after you make those.
*** @(TM2N2)@ @description@ string | ||
*** @(TM2N3)@ @metadata@ object - used to contain any arbitrary key value pairs of type string. | ||
** @(TM2O)@ @updatedAt@ time in milliseconds since epoch at which an operation occurred. This field is always populated on messages received with an @action@ of @MESSAGE_UPDATE@ or @MESSAGE_DELETE@.. | ||
** @(TM2P)@ @updateSerial@ string - an opaque string that uniquely identifies the operation. This field is always populated on messages received with an @action@ of @MESSAGE_UPDATE@ or @MESSAGE_DELETE@. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- the spec uses the convention that the letters in spec items other than the initial section name (eg the p in TM2p) is lowercase
- you reference a TM5 from the IDL that lists the actions, where is it?
Updated
Message
class in thetextile/features.textile
file to support new message fields related to materialisation.Additions to the
Message
class:action
field to represent the type of the message, using theMessageAction
enum. (serial
field to store the serial number of the message.refSerial
andrefType
fields for messages that reference other messages.updatedAt
andupdateSerial
fields to track the update and deletion ordering.operation
field, which is a object containing optional fields such asclientId
,description
, andmetadata
.