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

Secret phrase doesn't work in a specific case #4

Open
murilooon opened this issue Mar 3, 2021 · 1 comment
Open

Secret phrase doesn't work in a specific case #4

murilooon opened this issue Mar 3, 2021 · 1 comment

Comments

@murilooon
Copy link

murilooon commented Mar 3, 2021

Problem

When the bot success saving the secret phrase after failing once, the secret don't work.

Happened two times with me.

Here's the screenshot:

image
image
image

@murilooon murilooon changed the title Secret phrase doesn't work in some cases Secret phrase doesn't work in a specific case Mar 3, 2021
@murilooon
Copy link
Author

murilooon commented Mar 4, 2021

I sent the csv correctly, but in the screenshot above says 0 total codes.

Debugging

I found that this line fails the check: https://github.com/glamperd/POAPBot/blob/master/bot.js#L313
And probably this query is returning nothing: https://github.com/glamperd/POAPBot/blob/master/db/index.js#L103
The csv was uploaded correctly, but not persisted in the database as expected: https://github.com/glamperd/POAPBot/blob/master/bot.js#L575
The code didn't brake because there is no handle for the database insert here: https://github.com/glamperd/POAPBot/blob/master/bot.js#L272

We should check total_count before continuing, if returns 0 or error the user must upload again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant