Skip to content
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

Message send state #516

Closed
richardhuaaa opened this issue Feb 15, 2024 · 7 comments
Closed

Message send state #516

richardhuaaa opened this issue Feb 15, 2024 · 7 comments
Assignees

Comments

@richardhuaaa
Copy link
Contributor

richardhuaaa commented Feb 15, 2024

Expose optimistic message sends.

Per conversation/request from a partner on April 10, when we do this work, let's make sure
await group.send returns the group id (it currently returns the message ID)

@nmalzieu
Copy link

Hey @richardhuaaa , it's the opposite :) It currently returns the group id but it should return the message id (as we already know the group id!)

@richardhuaaa
Copy link
Contributor Author

Context: #529

@richardhuaaa
Copy link
Contributor Author

richardhuaaa commented Apr 16, 2024

After https://github.com/xmtp/libxmtp/pull/544/files#diff-3a24c3e76565487a710ac9863ac05160128f4f90892e07849b555a6de43a6e8f, optimistic messages will be inserted into the libxmtp DB and returned to the integrator when listing messages in a conversation, with delivery status UNPUBLISHED.

  • We might need a way to get the delivery status of messages
  • We could return the message ID from a message send, but unsure if it still matters here - the integrator doesn't need to manually create the optimistic message, it will be in the libxmtp DB
  • The optimistic message will be returned when listing messages, but won't be returned on subscriptions until they are updated to PUBLISHED. Does this matter?

@richardhuaaa
Copy link
Contributor Author

Naomi has a good Q: if the message send fails after 3 retries, do we delete the optimistic message?

@richardhuaaa
Copy link
Contributor Author

Maybe in addition to UNPUBLISHED and PUBLISHED, we should have a FAILED status

@richardhuaaa
Copy link
Contributor Author

Maybe add option to filter published/unpublished message

@nplasterer nplasterer self-assigned this Apr 16, 2024
@nmalzieu
Copy link

After https://github.com/xmtp/libxmtp/pull/544/files#diff-3a24c3e76565487a710ac9863ac05160128f4f90892e07849b555a6de43a6e8f, optimistic messages will be inserted into the libxmtp DB and returned to the integrator when listing messages in a conversation, with delivery status UNPUBLISHED.

  • We might need a way to get the delivery status of messages
  • We could return the message ID from a message send, but unsure if it still matters here - the integrator doesn't need to manually create the optimistic message, it will be in the libxmtp DB
  • The optimistic message will be returned when listing messages, but won't be returned on subscriptions until they are updated to PUBLISHED. Does this matter?

Getting back the message id from await group.send() would still be useful, because as you said, the subscriptions won't return the message, but we need a way to display it immediatly, and for that we need its unique id (so that when it's published and we get it back through subscriptions, we recognize it and don't show duplicates in the UI)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

4 participants