You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This new logic maintains `middleItem` according to its documented
relationship with `middleMessage`. Because of the current
definition of `middleMessage`, that produces the same result as
the previous definition of `middleItem`.
The key reasoning for why this logic works is: this touches all the
code that modifies `items`, to ensure that code keeps `middleItem`
up to date. And all the code which modifies `messages` (which is
the only way to modify `middleMessage`) already calls
`_reprocessAll` to compute `items` from scratch, except one site
in `_addMessage`. Studying `_addMessage`, it also maintains
`middleItem` correctly, though for that conclusion one needs the
specifics of the definition of `middleMessage`.
This change involves no new test code: all this logic is in
scenarios well exercised by existing tests, and the invariant-checks
introduced in the previous commit then effectively test this logic.
To be sure of that, I also confirmed that commenting out any one of
these updates to `middleItem` causes some tests to fail.
0 commit comments