-
Notifications
You must be signed in to change notification settings - Fork 687
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
Prevent duplicate instances of source /generate page #4996
Prevent duplicate instances of source /generate page #4996
Conversation
…4458) If a source clicks on 'Get Started' in two separate browser windows or tabs the second instance will redirect the source to the source index page with a flash message stating that another window is already on the 'Get Started' page. This addresses freedomofpress#4458 by ensuring only one instance of the /generate page can be opened at once.
I would appreciate comments on the flash message text (from a UX perspective). Thx. |
@DrGFreeman Hello, thank you for contributing! Reviewing related issues to understand the problem a bit better; will post more, later, once having conferred w/ the team wrt options on this. :)
TL;DR, I want to be mindful that we not impose our expectations of how the user should be behaving, onto a user, if there's either no clear benefit to the user as to why, or if it actually doesn't matter at this point in their process.
|
Functionality works as per test plan, but one case it doesn't address is the scenario where:
The messaging could address this - something like "A codename has already been generated for your session. Please return to the window or tab in which your codename was first generated to continue, or press New Identity to start over" (This is pretty similar to the existing text, but doesn't assume Tab A still exists and asks people to get a new Tor identity explicitly rather than closing browser windows.) |
Yeah, I just don't feel a message is the best way to be handling this—from what I've read on the issues filed that this was built to address. Automagic redirects to wherever the user already is in the flow with the 1st codename, feels like a much better way to be handling it. The text in the message I don't feel can be kept to the 1-2 sentence maximum, on an aside, for handing both use cases. To me, that's a caveat for all messaging. Tangentially: this handling of concurrent sessions (with a message) is an older interaction pattern, not seen much anymore on modern consumer webapps. These are the design principles previously established, for the Source UI. Unfamiliar patterns can compromise a user's ability to trust an experience, and disrupt their calm when navigating the experience. Those are my core two reasons for desiring an automagic redirect. |
I get your point - the Source Interface can't really be expected to have all the same behaviours available as on modern webapps, due to the contraints imposed by the lack of JS on the recommended TBB security slider setting, but we should be able to figure out a better strategy here. At the same time, this PR does fix an existing bug and provide guidance to the user on the safest path for them to follow, so with the promise of looking at the broader issue of session setup and management, and a tweaked flash message, I'd say it's a good addition. |
Thanks from me as well, @DrGFreeman, for taking a stab at fixing this bug! As Nina mentioned, there are significant UX implications to any fix of the original issue, beyond the text of a message. More thoughts on that later today. For now, just a quick note that as currently written, this PR introduces a regression, at least in my local testing: you can no longer reload the STR
Expected behavior
Actual behavior
|
Even if the issue above is fixed and the message is updated, we still have the UX issue of potentially "trapping" the user in a "computer broken please press button" workflow (one which still presents all other aspects of the UI as if they were functional), which is a user experience we should IMO avoid if at all possible. Here's the behavior that Nina and I would propose, after consideration:
This is not without remaining UX issues. The user in 1) may have written down the wrong codename, and may not notice the alert. However, we would recommend addressing this in follow-up issues, to get to a resolution of the original issue as quickly as possible. @DrGFreeman @zenmonkeykstop @redshiftzero What do you think? Does that approach make sense to you? |
Yup, that addresses the error that I saw as well. |
Recapping and considering the situations presented above - this bug is a situation where our duplicate codename logic can result from normal operation:
Previously we didn't consider this case, and as such we had this exception handling which sets the user as logged out and intentionally causes the 500 server error. Since this is something that we realize can happen in routine operation, a fix for this bug that also handles the cases discussed above is just removing the logic here. An attacker doesn't learn anything new: they learn already via the 500 that this is a valid codename, which they can then use to login (note: making it infeasible for attackers to guess valid codenames is why we have such a long codename generated from a large wordlist). While this fixes the 500, it instead logs the user in with a potentially unexpected codename that they haven't written down. Since |
Mmmhhh... Loads of appreciation for all of the thought everyone has invested in this issue. I only grumble with discontent, because—holy cow—we just don't seem to have the bandwidth right now, to do the design, research, design iteration, and then frontend execution on a proper fix. @redshiftzero The positioning of what I've been calling the "Codename Widget" on the I really dislike the 500-Error, but for now I appreciate that it at least flags to the user that something is super wrong—and that they should start over again. Which is a "shitty" experience, but it's not a "confusing" experience (in the sense that confusion might lead to error on their part). I'd rather be shitty than confusing, if I had to pick one over the other. Especially since our users are here with a clear purpose, and we're not worried about losing a passively engaged "meh" kinda user. My preference would be to give Source users the "shitty" 500-error experience, for now, while designing/testing a better one to implement immediately after we've launched the Workstation Pilot. It's mid-November, now. If the Workstation Pilot keeps on schedule, user testing and design iterations should have a solid solution established for implementation to address all Codename-experience things, come Feb; one that will resolve all usability issues associated with Source use/retention of codenames, which will also (hopefully!) improve things for Journalists by reducing the number of "Same Source, different codename" instances (identified as a common problem in both the recent survey, and in interviews). Whatcha think @redshiftzero? @eloquence Thoughts, @eloquence? Again: I so appreciate the desire to not give our users a shitty experience. I don't want that, either. Tough choices + acting with intent, however, feel like a necessary growing-pain for us to lean-into as a team, now, however. If @DrGFreeman or another volunteer would be keen to help implement a solution once validated by user testing, we could also get something better deployed, much sooner; but I doubt I can get a validated solution out, before mid-Jan (budgeting for holidaze & such). |
I consider the current behavior buggy in the narrow sense (it exposes an internal error to the user, which should never happen during normal operation). It is also confusing, because it logs the user out of both sessions. If they attempt an operation in the original tab, they will just be redirected to the "Enter codename" page, and anything they submitted as part of that operation will be silently discarded (!). My read of @redshiftzero's proposal is pretty straightforward: do the redirection, but make it a bit more obvious what's going on by crafting a custom message, like:
I think that's reasonable to resolve the immediate issue, understanding that it does not eliminate all residual risk of confusion. I agree the "codename" flow needs UX attention, but I don't think we should defer fixing this edge case bug until then. |
WRT Jen's proposal... I'm concerned about exposing the Codename in such a visible fashion, as a violation of opsec for shoulder surfers. Giving Sources agency to show and hide the codename at their leisure, gives them the opportunity to use SD in plain sight and with folks behind them (such as in a cafe), but without that most critical piece of their experience exposed—until they have a chance to hide that part of their screen from view. If they know to be that careful. If we were to implement Jen's proposal, I'd at least want to re-word it so that it says something to the effect of:
Is there a way to either extract random words from the codename to throw into such a message, or to always extract the 2nd and the 7th word (or something similarly predictable, which would be less desirable imho because it'd compromise security to a shoulder surfer)? |
The codename is shown in full on the previous page, which the user will have to dwell on for a significant amount of time. That said, I share some mild discomfort revealing it in contexts where it is not currently revealed by default. An alternative to picking selected words would be to incorporate the same show/hide logic we already use on the bottom of the page:
|
I like the idea of embedding the hide/show widget in the message, as as simpler approach that achieves the same goal. WRT
I don't feel we know enough about how Sources use SD, to assume it's safe to plainly expose the codename to them, ever—eg on the I consulted with colleagues some time ago, who've worked on both GMail and Yahoo! Mail, as well as banking apps, and none of them had ever seen a user attempt to memorize a password. That we'd expect users to memorize a 7-word long passphrase w/o ample research on actual Sources to prove that they would, feels dangerously optimistic. TL;DR, I don't feel it's safe to assume users dwell on the Anyhow—without distracting on the above paragrpah's tangent—I'll work on a mockup of how to show/execute something around what Jen proposed, and with the hide/show widget embedded. Will get that out sometime tomorrow, if that's ok. Meanwhile, I'll cross-reference this PR in a new Issue in the UX repo, to be sure we consider this use-case in a future examination of the Codename experience... which I do feel needs re-examination as a near-term priority among Source UI things. |
Perfect, thanks. :)
Agreed, it's also high on my mental list of UX issues to consider in the Source Experience once we have bandwidth for it. @DrGFreeman - thanks for your patience and please don't hesitate to jump in if you have thoughts re: the user experience considerations discussed so far. |
Thanks to all for the feedback and sorry I didn't jump in earlier as I didn't have time to allocate to this project since submitting the PR. The solution to this apparently simple issue is indeed more complicated than it seems and I appreciate the discussion on the pro & cons of different options. Referring to the steps described by @redshiftzero,
my attempt was aimed at solving the risky codename confusion in 3) by preventing the generation of codenames in duplicate tabs altogether, thus eliminating the path to the 500 error at the same time. This has its drawbacks from a user experience perspective, i.e. the inability to refresh the To paraphrase @ninavizz, this would be a "shitty" experience, but not a "confusing" experience. The solution proposed by @redshiftzero has the merit of being much smoother for the user while ensuring the source is aware of the "final" codename used. However, I believe it can still lead to confusion as to why the codename is Y if the user clicked "Submit Documents" in tab A where codename X was displayed. I will rally to whatever solution is agreed upon and will remain available to help with its implementation ;) |
I was thinking about this issue and had an idea. My experience with Flask and HTML forms is limited and I don't know if this is feasible or exactly how that would be done but here it is: If, in each browser tab where Does this make sense? |
Hey @DrGFreeman, sorry we've not followed up further on this yet. As discussed, we're leaning towards the approach outlined in this comment, with an inline show/collapse of the codename in the message. Nina will be proposing styling for that soon, but if you want to take a stab at testing an implementation approach with placeholder messaging/styling for now, we can iterate from there. If you prefer to wait for more UX and technical input, we should be able to respond in a few days. |
Hi @eloquence, as per your suggestion, I've started an implementation of the changes proposed in #5048 and am looking for comments from the team. |
@DrGFreeman - OK with me closing this PR in favour of #5048 ? |
@zenmonkeykstop - Absolutely. I wasn't sure if I should do it myself so I let it open until #5048 was reviewed. Closing it now. |
Status
Ready for review
Description of Changes
Fixes #4458.
If a source clicks on 'Get Started' in two separate browser windows or tabs, instead of returning a server error (status code 500), the second instance will redirect the source to the source index page with a flash message stating that another window is already on the 'Get Started' page.
Testing
How should the reviewer test this PR?
Deployment
Any special considerations for deployment?
No special considerations.
Checklist
If you made changes to the server application code:
make lint
) and tests (make test
) pass in the development containerIf you made changes to
securedrop-admin
:make -C admin test
) pass in the admin development containerIf you made changes to the system configuration:
If you made non-trivial code changes:
Test added in
tests/functional/test_source_warnings.py
.If you made changes to documentation:
make docs-lint
) passed locallyIf you added or updated a code dependency:
Choose one of the following: