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

[Edge Case] Handle the Empty file Upload #104

Open
ksdkamesh99 opened this issue Apr 12, 2021 · 12 comments
Open

[Edge Case] Handle the Empty file Upload #104

ksdkamesh99 opened this issue Apr 12, 2021 · 12 comments
Assignees
Labels
enhancement New feature or request Retrospective

Comments

@ksdkamesh99
Copy link
Member

If the user uploads an empty file then it should stop the upload and send an alert to the user stating that the uploaded file is empty.

@ksdkamesh99 ksdkamesh99 self-assigned this Apr 12, 2021
@ksdkamesh99 ksdkamesh99 added Retrospective enhancement New feature or request labels Apr 12, 2021
@elleanne
Copy link

I would like to work on this issue!
It looks like what you're talking about is line 52 in Dashboard/dashboard.jsx, const captureFile = (files, event) => ?
Or is it line 74, const onSubmit = async (event) => { ?

@Sameerkash
Copy link
Member

@Eliboss, sure please go ahead, I think this could be accomplished while the file is captured, you can read the contents of the file, similar code is available here

function readkeyFile(file) {

so you could similarly read the file, or compare its size and ensure it's not 0 bytes. and then send an alert and return.

@elleanne
Copy link

Awesome, I'll work on it today!

@elleanne
Copy link

I tried signing up both locally and on your deployed site so I could test this issue. The same issue occurred on both host sites, shown below.

Does this have to do with adding a local host network to MetaMask?

Locally
Screen Shot 2021-04-15 at 3 09 53 PM
Deployed
Screen Shot 2021-04-15 at 3 09 46 PM

@elleanne
Copy link

Update: I was able to upload a .pem file on the signin page without having an account (Though, of course, couldn't cont. past that page)
The alert worked when the .pem file had no text in it

@ksdkamesh99
Copy link
Member Author

@Eliboss Thanks for solving the issue. If you want to upload any file then metamask is needed in each timestep. The issue is not for only pem file it's about the files in drag and drop as well

@elleanne
Copy link

ah, ok. It sent me an alert that only .pem files could be uploaded on the signin page. If I need to check the drop in drag, Ill need a login. But I was having issues with that (see above comment). If you can get me connected to that, Ill look at it tomorrow.

@Sameerkash
Copy link
Member

ah, ok. It sent me an alert that only .pem files could be uploaded on the sign-in page. If I need to check the drop-in drag, I'll need a login. But I was having issues with that (see above comment). If you can get me connected to that, I'll look at it tomorrow.

@Eliboss mostly looks like a meta mask error, do you have MetaMask extension installed?

@ksdkamesh99
Copy link
Member Author

ok @Eliboss
As this is an edge case and it needs to be fixed asap there are 2 options with us. One to make you understand the metamask one or the maintainer team need to solve it asap. Kindly respond in our discord channel.

@ksdkamesh99
Copy link
Member Author

@Eliboss One more thing is you should not make any PR to main. Any PR should be made to staging as per the guidelines.

@elleanne
Copy link

@ksdkamesh99 I dont see your discord link anywhere. Can you send it to me?

@Priyanshu-official
Copy link

Priyanshu-official commented Apr 30, 2021

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

No branches or pull requests

4 participants