Skip to content
This repository has been archived by the owner on Nov 14, 2022. It is now read-only.

Clear closed tabs #42

Closed
5 tasks
vladdoster opened this issue Oct 31, 2019 · 14 comments
Closed
5 tasks

Clear closed tabs #42

vladdoster opened this issue Oct 31, 2019 · 14 comments
Assignees
Labels
enhancement New feature or request

Comments

@vladdoster
Copy link
Collaborator

vladdoster commented Oct 31, 2019

Description

I promise I am going to get around to #14, but we should first tackle the hack that is tab closing. I was working on #13 and realized that tab closing is ugly and doesn't actually close the session on the back-end. I am working on the front-end/back-end code to close tabs and propagate that to the back-end.

Could be seen as an attack vector.

Screenshots

"closed tab" where session is still live

Files

  • app.py
  • app.js

To Reproduce

Close tab and check if it closed on the server.

Tasks

Include specific tasks in the order they need to be done in. Include links to specific lines of code where the task should happen at.

  • Tell server to close session
  • Update UI
  • Write E2E test
@vladdoster
Copy link
Collaborator Author

Feel free to assign to me, going to knock out here in next couple of days. I have most of the front-end code working but realized it wasn't updating back-end.

@0xHericles
Copy link
Owner

Okay @vladdoster! Thanks for noticing that. Sure, I'll assign you! :D

Btw, you're doing an amazing work! 🚀

@satanb4
Copy link
Contributor

satanb4 commented Oct 31, 2019

@vladdoster I was working on closing the session specific to the SSID. However, this issue was raised as a part of MiguelGringberg's Flask-SocketIO repository about gracefully exiting the socket connection. You can go through these issue1 and issue2

@vladdoster
Copy link
Collaborator Author

@vladdoster I was working on closing the session specific to the SSID. However, this issue was raised as a part of MiguelGringberg's Flask-SocketIO repository about gracefully exiting the socket connection. You can go through these issue1 and issue2

From what I could collect, one would just close a session with a HTTP request?

@satanb4
Copy link
Contributor

satanb4 commented Oct 31, 2019

@vladdoster I was working on closing the session specific to the SSID. However, this issue was raised as a part of MiguelGringberg's Flask-SocketIO repository about gracefully exiting the socket connection. You can go through these issue1 and issue2

From what I could collect, one would just close a session with a HTTP request?

The unload event needs to be called in order to close a session. If you want, I'll take a look at this as well. Since a socket connection is already created, you don't have to send an HTTP request, that would be unsafe since you would have to pass the session variable. The socket just has to send an event trigger with the Session ID.

@0xHericles 0xHericles added the enhancement New feature or request label Oct 31, 2019
@vladdoster
Copy link
Collaborator Author

vladdoster commented Oct 31, 2019

@vladdoster I was working on closing the session specific to the SSID. However, this issue was raised as a part of MiguelGringberg's Flask-SocketIO repository about gracefully exiting the socket connection. You can go through these issue1 and issue2

From what I could collect, one would just close a session with a HTTP request?

The unload event needs to be called in order to close a session. If you want, I'll take a look at this as well. Since a socket connection is already created, you don't have to send an HTTP request, that would be unsafe since you would have to pass the session variable. The socket just has to send an event trigger with the Session ID.

Ah I see. That makes sense. So not trying to rush you at all, but do you think youll have it done this weekend? If not, I am going to wrap up my code and push it for review friday/saturday? Maybe We can merge our solutions? Only because I want to use this on my personal system but the tabs issue is holding it back from adoption.

@satanb4
Copy link
Contributor

satanb4 commented Oct 31, 2019

@vladdoster I was working on closing the session specific to the SSID. However, this issue was raised as a part of MiguelGringberg's Flask-SocketIO repository about gracefully exiting the socket connection. You can go through these issue1 and issue2

From what I could collect, one would just close a session with a HTTP request?

The unload event needs to be called in order to close a session. If you want, I'll take a look at this as well. Since a socket connection is already created, you don't have to send an HTTP request, that would be unsafe since you would have to pass the session variable. The socket just has to send an event trigger with the Session ID.

Ah I see. That makes sense. So not trying to rush you at all, but do you think youll have it done this weekend? If not, I am going to wrap up my code and push it for review friday/saturday? Maybe We can merge our solutions? Only because I want to use this on my personal system but the tabs issue is holding it back from adoption.

I don't think that the backend session not closing is going to impede any form of functionality for the user, since it pretty much disables the tab for inputs. Also, you bring up a good point that I have been thinking about. The mechanism of socket triggering on every button is really slowing down the input of the user. I am thinking of an enhancement in the form of a buffer in the front-end so that the command is executed only when return is pressed. The input delay, is an issue that needs to be addressed before the software can have a functional release. Any thoughts @hericlesme ?

And about the session-close, I'll try to wrap it up this weekend. Cannot promise though, requires a bit of research due to even Miguel's hesitance to deal with gracefully closing connections based on SSIDs from one page route.

@0xHericles
Copy link
Owner

Also, you bring up a good point that I have been thinking about. The mechanism of socket triggering on every button is really slowing down the input of the user. I am thinking of an enhancement in the form of a buffer in the front-end so that the command is executed only when return is pressed. The input delay, is an issue that needs to be addressed before the software can have a functional release. Any thoughts @hericlesme ?

@satanb4 Yes, I noticed that too. I want to fix it and some other things before publishing a stable release. I'll also create a new issue from this, so we can discuss it better.

@vladdoster
Copy link
Collaborator Author

So I realized why we keep tabs around, so you can download the log if need be. I propose moving closed tabs to a dropdown list somewhere to the right near the connection status and then clear tabs so its not so cluttered.

@satanb4
Copy link
Contributor

satanb4 commented Nov 2, 2019

So I realized why we keep tabs around, so you can download the log if need be. I propose moving closed tabs to a dropdown list somewhere to the right near the connection status and then clear tabs so its not so cluttered.

From a UX point of view, having the prompt for log beside the closed tabs makes more sense as that would be the usage of the person. And what seems so cluttered? The front-end code, or the UI?

@0xHericles
Copy link
Owner

In my opinion, I think we can have a great user experience if the log is available for download at any time since session creation. Therefore, we can request a confirmation from the user when they want to close the session.

@satanb4
Copy link
Contributor

satanb4 commented Nov 2, 2019

Ah! I see the use-case. I'll implement it in the next PR

@0xHericles
Copy link
Owner

Great @satanb4! ^^

@0xHericles
Copy link
Owner

@vladdoster are you working at #13? If so, I will assign it to you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants