zulip-terminal icon indicating copy to clipboard operation
zulip-terminal copied to clipboard

model: Inform user if message was not sent successfully.

Open amanagr opened this issue 5 years ago • 15 comments

amanagr avatar Jun 01 '19 10:06 amanagr

This looks like a nice addition! Just tried this and the 3 seconds seems fine for now, though we can probably reduce it a bit (based on more feedback of-course)

sumanthvrao avatar Jun 01 '19 12:06 sumanthvrao

Actually this was wip, I forgot to mention, Yeah the first commit is from another PR. Thanks for the review. Nice points, I will try and fix them.

amanagr avatar Jun 02 '19 03:06 amanagr

I won't review until you're ready, but whether in this PR or a follow-up, we could also have something similar which managed other actions too; this was just made clear when czo was updated this afternoon :)

neiljp avatar Jun 02 '19 23:06 neiljp

@neiljp I feel this is mostly ready. For the short network outrage issue, do we really need to deal with it since the message is being successfully sent in the end?

amanagr avatar Jun 03 '19 17:06 amanagr

@neiljp I feel this is mostly ready. For the short network outrage issue, do we really need to deal with it since the message is being successfully sent in the end?

To clarify, the issue here is that the message was sent, but the notice given to the user in the footer is that it wasn't.

neiljp avatar Jun 04 '19 05:06 neiljp

@neiljp thanks for the find. I was able to reproduce. Seems like a tricky case. We send the request to client and client returns a response, that should end the thread right since we are not longpolling here or not doing any error_retries?

amanagr avatar Jun 04 '19 17:06 amanagr

re: last commit contains two changes? -> Do you want to split the send_lock part? re: I'm a little wary of having the model access the view via the controller, which wasn't the case when this occurred in the keypress method? -> We can add a method for updating footer to the controller so that it's easy for various functions in model (even in future) to update the footer. re:The lock could resolve the timing issue -> Yeah it's a tricky case would love to have additional ideas.

amanagr avatar Jun 17 '19 04:06 amanagr

  • Re 2 changes, it felt like you had restructured and added the lock in the same commit? If the code stays in that form, it felt like the restructure should be in a separate commit, or just be part of the first one
  • I understand that you want to place the lock in the model; it feels like it could also work with the lock in a controller method, and then that method could update the UI?

neiljp avatar Jun 17 '19 16:06 neiljp

I removed the lock and asynch, it works fine without them both.

amanagr avatar Jun 18 '19 03:06 amanagr

@amanagr I'm observing the same behavior here as before; trying to send with no network:

  • doesn't update the UI with 'Sending...' at all
  • pauses the UI for the non-longpolling 15s
  • shows the the failure message
  • if reconnected "quick enough", does actually send the message?

I expect we want the 15s timeout for actually sending, which suggests we do want something with asynch?

With network, it's fine, in that it updates the bar with a temporary success message, but that's not the complex part.

neiljp avatar Jun 19 '19 03:06 neiljp

@amanagr A small extension here would be to have the footer display when a message is sent out the current narrow (somewhat similar to the web app message we get).

sumanthvrao avatar Aug 04 '19 15:08 sumanthvrao

Another extension could include to indicate that the message is below the current view, though that might be difficult to determine, I'm not sure?

neiljp avatar Aug 04 '19 16:08 neiljp

Thanks for the suggestions!

amanagr avatar Aug 04 '19 18:08 amanagr

@neiljp I am unable to figure out why the message is being successfully sent after we get an error response from the server in this case. Do you have any ideas as to why this might be happening given your history with the python-zulip-api?

amanagr avatar Aug 05 '19 14:08 amanagr

Heads up @amanagr, we just merged some commits that conflict with the changes your made in this pull request! You can review this repository's recent commits to see where the conflicts occur. Please rebase your feature branch against the upstream/master branch and resolve your pull request's merge conflicts accordingly.

zulipbot avatar Apr 17 '20 00:04 zulipbot