user dialog-status: port the v1 read-state hotfix (d7e2724) to the v2 operation - #14
Merged
Merged
Conversation
Ports d7e2724 from v1. `messages.getPeerDialogs` already returns the whole dialog object; the op read `top_message` off it and threw the rest away, so the command could not answer "have they read our message?" — and answered it wrongly by omission: the key was simply absent, so a caller reading it back got null, which is indistinguishable from "not read". `chat list` reports the same field, so the two routes disagreed about the same peer. Adds read_outbox_max_id, unread_count and top_message to DialogStatus and to every return path of the op, including the indeterminate one (null, since ContactModel sets omit_defaults=False the keys are still emitted) and the definitive negative (0). Deliberately no derived "they_read_it" boolean: that comparison is only meaningful when the last message is ours, which only the caller knows. The three-valued contract, exit 13 and every existing key are untouched; the peer-dialogs fake already carried all three fields, so only the tests moved.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ports the v1 hotfix d7e2724 ("user dialog-status: report the peer's read state, always"), which landed on the production branch
v2, into the v2 operationuser dialog-status.read_outbox_max_id,unread_countandtop_messageare now present on every return path (nullwhen indeterminate,0on the definitive negative), so "have they read our message?" is answerable and a missing key can no longer be mistaken for "not read".This was the only commit in
78a4934..origin/v2; nothing else needed porting.