Skip to content
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

snippets don't update when content of message/reply is updated #707

Closed
redshiftzero opened this issue Jan 18, 2020 · 9 comments · Fixed by #752
Closed

snippets don't update when content of message/reply is updated #707

redshiftzero opened this issue Jan 18, 2020 · 9 comments · Fixed by #752
Labels
bug Something isn't working

Comments

@redshiftzero
Copy link
Contributor

STR

  1. Submit a document so that there is a fresh submission to download in the next step.
  2. Login to the client.
  3. See the snippet displays our placeholder message.

Expected behavior

As the message downloads, the content updates in the sidebar also.

Actual behavior

The content is static, and will only refresh after a full sync (which will call the controller's update_sources method to update the sidebar).

Screen Shot 2020-01-17 at 8 42 12 PM

Comments

We do emit a signal each time a file, message, or reply is "ready" (i.e. has been successfully downloaded and decrypted), those signals are here, so we could use make use of them in the source list view to update the source list view elements when the content is updated.

@redshiftzero redshiftzero added the bug Something isn't working label Jan 18, 2020
@eloquence
Copy link
Member

Here's a pathological case:
Screenshot_2020-01-17_17-24-33

This is after login into a workstation that's not been initialized yet, with ~20 sources on the server. The preview snippets lag behind the actual retrieval and decryption of messages by a couple of minutes, i.e. I don't see previews for sources that do have content. Eventually they all display previews.

@redshiftzero
Copy link
Contributor Author

they eventually display previews after a full sync has occurred, which is why it takes a couple of mins

@sssoleileraaa
Copy link
Contributor

I was able to repro in the case where there is are new messages from new sources

@eloquence eloquence added this to Nominated for next sprint in SecureDrop Team Board Jan 20, 2020
@sssoleileraaa
Copy link
Contributor

The fix for this issue should also work when applied to #442, fyi

@ntoll
Copy link
Contributor

ntoll commented Jan 22, 2020

OK... I'm on this.

@ntoll
Copy link
Contributor

ntoll commented Jan 22, 2020

Actually, parking this for moment to fix #715.

@eloquence eloquence moved this from Nominated for next sprint to Current Sprint (1/22-2/5) in SecureDrop Team Board Jan 22, 2020
@ntoll
Copy link
Contributor

ntoll commented Jan 27, 2020

OK... this probably relates to some of the issues described in the update made in #733.

@ntoll
Copy link
Contributor

ntoll commented Jan 29, 2020

So I've been looking into this issue this afternoon. I'll push a branch/draft PR after stand-up (except it doesn't work).

I'm a bit stumped.

I can see messages, replies and files being downloaded, but in on_message_download_success (and related methods) the message doesn't actually have any content. When my slot catches the signal emitted by this method the same is still the case when I try to render the message as a snippet. Ergo, you just see the placeholder text instead of the content.

I've been tracing how this all fits together and, as far as I can tell, the database has been written to with the message content by the time methods like storage.get_message are called and the subsequent signal is fired. My expectation is that I'd get the latest copy of the message with the downloaded content when in the slot handling the signal. But None is returned as the content instead.

It's the end of the afternoon for me and I have tired eyes. I'll pick this up in the morning again and any pointers would be welcome. I've started looking at SqlAlchemy sessions and how one on one thread might update the database, but another (on the main thread) won't see the changes until... well, I'm speculating from the observed behaviour and need to investigate what perhaps needs to happen so a fresh SELECT is issued or a cache somewhere is cleared.

@ntoll
Copy link
Contributor

ntoll commented Jan 29, 2020

WiP (sitting on top of inline-conversation) is in my update-snippets branch (https://github.com/ntoll/securedrop-client/tree/update-snippets). It should be easy, but see above comment about debugging fun.

@ntoll ntoll mentioned this issue Jan 30, 2020
6 tasks
SecureDrop Team Board automation moved this from Current Sprint (1/22-2/5) to Done Feb 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

4 participants