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

As a user, I'd like to be able to close my browser window after I submit a web3 tx, so I can do other things without canceling. #128

Closed
owocki opened this issue Dec 15, 2017 · 20 comments

Comments

@owocki
Copy link
Contributor

owocki commented Dec 15, 2017

014429d

the issue

Once a user submits a new bounty / claim bounty / accept bounty, their browser is what polls web3 for the tx to be mined. When the tx is mined, their browser receives the updated info from the blockchain, and submits it to the server.

this is a problem because if the user closers browser window, or if they lose web3 connectivity, the backend won't update.

workaround

a workaround is if an admin is using the process_bounty.js helper script to process the bounty.

proposed root cause fix

there is a serverside management command called sync_geth. it is partially implemented right now. when it is fully implemented, it will poll / listen for changes to the jobs on web3 and update the server side immediately

@gitcoinbot
Copy link
Member

This issue now has a funding of 0.05 ETH (33.89 USD) attached to it.

  • If you would like to work on this issue you can claim it here.
  • If you've completed this issue and want to claim the bounty you can do so here
  • Questions? Get help on the Gitcoin Slack
  • $10303.76 more Funded OSS Work Available at: https://gitcoin.co/explorer

@wingleung
Copy link

Where can I find the partially implemented sync_get command?

@owocki
Copy link
Contributor Author

owocki commented Dec 18, 2017

@sc0Vu
Copy link
Contributor

sc0Vu commented Dec 18, 2017

@owocki Maybe it's better to run sync_geth as daemon on serverside?

@owocki
Copy link
Contributor Author

owocki commented Dec 18, 2017

sure. im open to that... we could put it into supervisorctl but first we need to get it working

@step21
Copy link

step21 commented Jan 4, 2018

Is someone working on this? Just curious, as I think I am not that familiar with the codebase to decide which way to handle this.

@abitrolly
Copy link
Contributor

Nobody claimed it, so feel free to do it. My question are - how state is stored and what is stored?

Is there something like this stored on server?

change requested -> transaction pending -> transaction completed
                                        -> transaction cancelled

So that when you reload the page, the state is shown on issue page?

@step21
Copy link

step21 commented Jan 6, 2018

You can look at /app/dashboard/models.py for example to get an idea of the database layout.
There is a model BountySyncRequest that gets then manually or otherwise processed as far as I can say. This is currently (not quite working) run by a cronjob that runs a django admin command.

@step21
Copy link

step21 commented Jan 8, 2018

One question I have about this - I am probably missing something, but what about this is not working right?
As I understand it, sync_get and the corresponding parts like process_bounty_changes should work, but there would need to bet a method/part in new_bounty.js, process_bounty.js, claim_bounty.js (or maybe at least claim_bounty) that adds a BountySyncRequest, which will then be picked up by from there. Correct?

@owocki
Copy link
Contributor Author

owocki commented Jan 8, 2018

sync_get

i believe that sync_get exits out with an exception right now.

also @jhaas is working on standardbounties integration.. we should hold off until that is merged in #140

@step21
Copy link

step21 commented Jan 8, 2018

ok. then I will in the meantime try running without docker, cause running those managing commands in docker was a pain

@owocki
Copy link
Contributor Author

owocki commented Jan 10, 2018

we should make it easier to run management commands in docker.. @mbeacom might know whats standard here :)

@mbeacom
Copy link
Contributor

mbeacom commented Jan 15, 2018

@step21 @owocki
You can execute the following management command from the root of your web repo directory while the docker compose stack is up and running via something like:

docker-compose exec web python app/manage.py collectstatic

The above example is broken down like so:
docker-compose <action> <stack_service/container_name> <command>

So you're telling docker-compose to execute the command: python app/manage.py collectstatic against the web service container.

So, for this particular situation, you could use: docker-compose exec web python app/manage.py sync_get

Let me know if you have any further questions or concerns!

@owocki
Copy link
Contributor Author

owocki commented Jan 26, 2018

this is unblocked now that standardbounties is out the door!

@step21
Copy link

step21 commented Jan 27, 2018

I will check if I can commit sth today

@step21
Copy link

step21 commented Jan 27, 2018

So... should this be combined with those two referenced issues or can it be split up somehow?

@owocki owocki added the to do label Jan 30, 2018
@owocki owocki changed the title Enable the user to close their browser window after submitting tx to web3 As a user, I'd like to be able to close my browser window after I submit a web3 tx, so I can do other things without canceling. Jan 30, 2018
@owocki
Copy link
Contributor Author

owocki commented Feb 1, 2018

im going to start on this tomorrow

@vs77bb
Copy link
Contributor

vs77bb commented Feb 13, 2018

Hi @owocki where is this one? @mbeacom and I discussed briefly at retreat... prob still outstanding?

@mbeacom
Copy link
Contributor

mbeacom commented Feb 13, 2018

@vs77bb This has been folded into #379 - We have a tentative rollout set for tomorrow.

@owocki
Copy link
Contributor Author

owocki commented Feb 14, 2018

this is done! 🎉

@owocki owocki closed this as completed Feb 14, 2018
@owocki owocki removed the to do label Feb 14, 2018
owocki pushed a commit that referenced this issue Apr 30, 2021
added discourse links everywhere :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants