mirror of https://github.com/zulip/zulip.git
fab64fd7b0
If the client is not composing a message, we can just force a page reload. However, if he is composing a message, we must preserve that message while still reloading as soon as possible. We take the following approach: if the client has not completed the composition after 5 minutes, do a compose-preserving reload (described below). If he sends the message before the timeout expires, reload the page after a successful send. If the send fails (not due to server timeout), however, we do a compose-perserving reload in case the error was due to the data format changing. If the send failed due to server timeout, we don't reload because the reload will probably also fail. In a compose-preserving reload, we redirect to an URI that has a fragment indicating we are doing a reload and containing all the necessary information for restoring the compose window to its previous state. On page load, we check the fragment to see if we just did a compose-preserving reload, and, if we did, we restore the compose window (or just try the send again in the case of send failure). The URI fragment looks like: (imported from commit af4eeb3930c24118e088057d4da456748fbd2229) |
||
---|---|---|
.. | ||
js | ||
styles | ||
third | ||
favicon.ico |