Skip to content

msglist test: Call checkInvariants on checkNotNotified. #769

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

Merged
merged 1 commit into from
Jun 28, 2024

Conversation

PIG208
Copy link
Member

@PIG208 PIG208 commented Jun 27, 2024

Stemmed from #766 (comment).

We already always check the invariants through a listener on the MessageListView instance. Now we do it more consistently when not notified.

Copy link
Member

@gnprice gnprice left a comment

Choose a reason for hiding this comment

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

Thanks for taking care of this!

One comment below. There's also another call site on L270 that can be cut.

checkNotified(count: 0);
checkInvariants(model);
Copy link
Member

Choose a reason for hiding this comment

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

Let's swap the order:

  • that matches what happens in the checkNotified case;
  • if both checks would fail, then the fact that invariants were broken is probably closer to the root of the issue and so the more helpful one to report.

@PIG208 PIG208 force-pushed the notified branch 2 times, most recently from baca9ac to 29f11e6 Compare June 28, 2024 19:43
@PIG208 PIG208 requested a review from gnprice June 28, 2024 21:59
We already always check the invariants through a listener on the
MessageListView instance. Now we do it more consistently when not
notified.

Signed-off-by: Zixuan James Li <zixuan@zulip.com>
@gnprice
Copy link
Member

gnprice commented Jun 28, 2024

Thanks! Looks good; merging.

@gnprice gnprice merged commit 1d24f6d into zulip:main Jun 28, 2024
@PIG208 PIG208 deleted the notified branch June 29, 2024 03:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants