Skip to content

Conversation

neiljp
Copy link
Collaborator

@neiljp neiljp commented Feb 15, 2021

Previously a draft was a Message, which is a much more complex data
structure received from the server with differently-named fields. The
draft system only requires the data which is subsequently sent via
the send_message API call, so a simpler API-specific set of data
structures are created and used for drafts named ~ Composition.

Other than typing, the new data structures allow space to define where
we wish to move to use newer API forms (ids vs strings) in future. An
extra 'stream_id' field is present in StreamComposition, not present in
the API, until we migrate to use IDs.

To emphasize the message/draft distinction and migration, variable names
are also updated to match.

Previously a draft was a Message, which is a much more complex data
structure received from the server with differently-named fields. The
draft system only requires the data which is subsequently sent via
the send_message API call, so a simpler API-specific set of data
structures are created and used for drafts named ~ Composition.

Other than typing, the new data structures allow space to define where
we wish to move to use newer API forms (ids vs strings) in future. An
extra 'stream_id' field is present in StreamComposition, not present in
the API, until we migrate to use IDs.

To emphasize the message/draft distinction and migration, variable names
are also updated to match.
@zulipbot zulipbot added the size: L [Automatic label added by zulipbot] label Feb 15, 2021
@neiljp neiljp merged commit 306a394 into zulip:main Feb 15, 2021
@neiljp neiljp added this to the Next Release milestone Feb 15, 2021
@zulipbot
Copy link
Member

Hello @zulip/server-refactoring members, this pull request was labeled with the "area: refactoring" label, so you may want to check it out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: refactoring size: L [Automatic label added by zulipbot]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants