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

chat: mention newestFirst in history spec #250

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AndyTWF
Copy link
Contributor

@AndyTWF AndyTWF commented Nov 29, 2024

No description provided.

@@ -299,7 +299,7 @@ Broadly speaking, messages are published via REST calls to the Chat HTTP API and
** @(CHA-M5c)@ @[Testable]@ If a channel leaves the @ATTACHED@ state and then re-enters @ATTACHED@ with @resumed=false@, then it must be assumed that messages have been missed. The @subscription point@ of any subscribers must be reset to the @attachSerial@.
** @(CHA-M5d)@ @[Testable]@ If a channel @UPDATE@ event is received and @resumed=false@, then it must be assumed that messages have been missed. The @subscription point@ of any subscribers must be reset to the @attachSerial@.
** @(CHA-M5e)@ Each subscription shall expose a method or callback that allows for messages to be queried. These messages are queried via the "REST API"#rest-fetching-messages.
** @(CHA-M5f)@ @[Testable]@ This method must accept any of the standard history query options, except for @direction@, which must always be @backwards@.
** @(CHA-M5f)@ @[Testable]@ This method must accept any of the standard history query options, except for @direction@, which must always be @newestFirst@.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

orderBy?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doh!

@@ -299,7 +299,7 @@ Broadly speaking, messages are published via REST calls to the Chat HTTP API and
** @(CHA-M5c)@ @[Testable]@ If a channel leaves the @ATTACHED@ state and then re-enters @ATTACHED@ with @resumed=false@, then it must be assumed that messages have been missed. The @subscription point@ of any subscribers must be reset to the @attachSerial@.
** @(CHA-M5d)@ @[Testable]@ If a channel @UPDATE@ event is received and @resumed=false@, then it must be assumed that messages have been missed. The @subscription point@ of any subscribers must be reset to the @attachSerial@.
** @(CHA-M5e)@ Each subscription shall expose a method or callback that allows for messages to be queried. These messages are queried via the "REST API"#rest-fetching-messages.
** @(CHA-M5f)@ @[Testable]@ This method must accept any of the standard history query options, except for @direction@, which must always be @backwards@.
** @(CHA-M5f)@ @[Testable]@ This method must accept any of the standard history query options, except for @orderBy@, which must always be @newestFirst@.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
** @(CHA-M5f)@ @[Testable]@ This method must accept any of the standard history query options, except for @orderBy@, which must always be @newestFirst@.
** @(CHA-M5f)@ @[Testable]@ This method can accept any of the standard history query options, except for @orderBy@, which must always be @newestFirst@.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original wording is correct here imo - it's saying the method must accept any of the standard arguments, i.e. its talking about the method signature. It would not be acceptable for the method not to accept the limit param, for example.

Copy link
Collaborator

@sacOO7 sacOO7 Dec 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But, we also have default values for QueryParam arguments.
Okay maybe

Suggested change
** @(CHA-M5f)@ @[Testable]@ This method must accept any of the standard history query options, except for @orderBy@, which must always be @newestFirst@.
** @(CHA-M5f)@ @[Testable]@ This method signature must have all history query options as params, except for @orderBy@, which must always be @newestFirst@.

This feels less confusing. Because there's a diff. in accepting the argument and defining it as a part of method signature.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels more explicit and there won't be implicit misunderstandings wdyt

Copy link
Contributor Author

@AndyTWF AndyTWF Dec 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Downside with this wording is that it would be overly-prescriptive. This wording strongly requires that each history query option must be an individual arg to the function - that's not the case in JS (the history options are an object - which is common in other languages for the core SDK too).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, got it.
But, I would still recommend to make statement more explicit that fits across SDKs in general.
I will approve the PR for now 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants