There is a bug and race issue that occurs when a message is selected while we are in the process of reifying a locally echoed message, raising the "Selected message id not in MessageList" error. The code flow to get the exception is as follows: * A user sends a message to the current narrow we are in. * Before the new message event is received, we sent a message to the same message list which renders it with a locally echoed id. * One of the ways of getting the exception is to already have the locally sent message selected, before receiving an acknowledgment from the server. * Thus the Message List Data's `selected_id` now points to the new message id. The exception is raised on entering the `was_selected` if block inside `message_list_view` which tries to re-select the message. Updating the `_rerender_message` code for this special case won't fix the entire bug because, as mentioned above there are other ways of getting the exception: Ideally, after all our synchronous work (`echo.process_from_server`) has completed we would expect the re-order and re-render work of the `change_message_id` would occur first, due to the timer of the setTimeout being set to 0. However as evident from the race condition existing, this isn't always the case. `change_message_id` function is responsible for 3 things: updation, re-ordering and re-rendering. The first one which is responsible for updating the message list's local cache, occurs synchronously while for the latter two, they both occur asynchronously. Before the setTimeout which is responsible for the latter two actions, is encountered the user might select the message by clicking or more commonly by scrolling, which causes this message selection event to be ahead of the setTimeout in the callback queue. During this time frame, our race condition takes place. And even though the message id is updated it's Message List is not in the correct sort order, which leads to `closest_id` !== `id` in `MessageList_select_id` being true and raising the exception. Now, we only asynchronously call the re_render function, to guarantee the data is always correct and UI updates should be done at the end. Extended by tabbott to comment the setTimeout call. Fixes #15346. |
||
|---|---|---|
| .circleci | ||
| .github | ||
| .tx | ||
| analytics | ||
| confirmation | ||
| corporate | ||
| docs | ||
| frontend_tests | ||
| locale | ||
| pgroonga | ||
| puppet | ||
| requirements | ||
| scripts | ||
| static | ||
| stubs | ||
| templates | ||
| tools | ||
| zerver | ||
| zilencer | ||
| zproject | ||
| zthumbor | ||
| .browserslistrc | ||
| .codecov.yml | ||
| .editorconfig | ||
| .eslintignore | ||
| .eslintrc.json | ||
| .gitattributes | ||
| .gitignore | ||
| .gitlint | ||
| .isort.cfg | ||
| .mailmap | ||
| .npmignore | ||
| .pyre_configuration | ||
| .sonarcloud.properties | ||
| .stylelintrc | ||
| .yarnrc | ||
| babel.config.js | ||
| CODE_OF_CONDUCT.md | ||
| CONTRIBUTING.md | ||
| Dockerfile-postgresql | ||
| LICENSE | ||
| manage.py | ||
| mypy.ini | ||
| NOTICE | ||
| package.json | ||
| postcss.config.js | ||
| README.md | ||
| SECURITY.md | ||
| tsconfig.json | ||
| Vagrantfile | ||
| version.py | ||
| yarn.lock | ||
Zulip overview
Zulip is a powerful, open source group chat application that combines the immediacy of real-time chat with the productivity benefits of threaded conversations. Zulip is used by open source projects, Fortune 500 companies, large standards bodies, and others who need a real-time chat system that allows users to easily process hundreds or thousands of messages a day. With over 500 contributors merging over 500 commits a month, Zulip is also the largest and fastest growing open source group chat project.
Getting started
Click on the appropriate link below. If nothing seems to apply, join us on the Zulip community server and tell us what's up!
You might be interested in:
-
Contributing code. Check out our guide for new contributors to get started. Zulip prides itself on maintaining a clean and well-tested codebase, and a stock of hundreds of beginner-friendly issues.
-
Contributing non-code. Report an issue, translate Zulip into your language, write for the Zulip blog, or give us feedback. We would love to hear from you, even if you're just trying the product out.
-
Supporting Zulip. Advocate for your organization to use Zulip, write a review in the mobile app stores, or upvote Zulip on product comparison sites.
-
Checking Zulip out. The best way to see Zulip in action is to drop by the Zulip community server. We also recommend reading Zulip for open source, Zulip for companies, or Zulip for working groups and part time communities.
-
Running a Zulip server. Use a preconfigured Digital Ocean droplet, install Zulip directly, or use Zulip's experimental Docker image. Commercial support is available; see https://zulip.com/plans for details.
-
Using Zulip without setting up a server. https://zulip.com offers free and commercial hosting, including providing our paid plan for free to fellow open source projects.
-
Participating in outreach programs like Google Summer of Code.
You may also be interested in reading our blog or following us on twitter. Zulip is distributed under the Apache 2.0 license.