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

api: Return anchor in get_messages when use_first_unread_anchor=True #8373

Closed
wants to merge 1 commit into from

Conversation

shubham-padia
Copy link
Member

fixes #6244
@timabbott Please review

@zulipbot
Copy link
Member

zulipbot commented Feb 14, 2018

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

self.login(self.example_email("hamlet"))
result = self.get_and_check_messages(dict(use_first_unread_anchor='true'))
self.assertIn("anchor", result)

Copy link
Sponsor Member

Choose a reason for hiding this comment

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

I'd probably just add the assert to an existing test for use_first_unread_anchor.

"use_first_unread_anchor": ujson.dumps(use_first_unread_anchor)}
result = self.client_get("/json/messages", dict(post_params))
data = result.json()
return data
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

Let's not duplicate the code from get_messages; we should just have get_messages be a wrapper for this that just returns the messages part.

@timabbott
Copy link
Sponsor Member

Generally looks good @shubham-padia! I posted a few comments.

@shubham-padia
Copy link
Member Author

@timabbott I've made the changes

@shubham-padia
Copy link
Member Author

@timabbott Please review

@timabbott
Copy link
Sponsor Member

Looks great, merged as a4b6862 after expanding the commit message to better explain the change.

@timabbott timabbott closed this Feb 16, 2018
@shubham-padia shubham-padia deleted the anchor branch September 8, 2018 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Return anchor in get_messages when use_first_unread_anchor=True
4 participants