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

Only subscribe on connect/reconnect, remove refresh interval #69

Merged
merged 2 commits into from
Mar 18, 2023

Conversation

who-biz
Copy link
Contributor

@who-biz who-biz commented Mar 15, 2023

  • Previously, epic-wallet was unsubscribing, and re-subscribing every time a challenge was received from epicbox over WS
  • This was unnecessary, and subscription only needs to happen once per connection (provided connection remains alive)
  • This commit moves initial subscription from a challenge response, to central Subscribe function

These changes have been extensively tested by EpicBox Server chat testers, and plays nicely with https://github.com/fastepic/epicboxnodejs.

- Previously, epic-wallet was unsubscribing, and re-subscribing every time a challenge was received from epicbox over WS
- This was unnecessary, and subscription only needs to happen once per connection, provided connection remains alive
- This commit moves initial subscription from a challenge response, to central Subscribe fn
@who-biz
Copy link
Contributor Author

who-biz commented Mar 15, 2023

Will likely be adding to these changes to remove most of the refresh_interval code, as it's not needed in most places any longer... But, wanted to get these in so that epicbox initiatives can move forward.

- Probably can remove a lot more of code related to refresh interval
- But, proceeding with caution due to something in the challenge sections/refresh interval sections causing a hang in epic-wallet calls, when all is removed
- Working on figuring out what the problem area is
- For now, this commit is fully functional, when taken in tandem with the prior
@who-biz who-biz changed the title Only subscribe on connect/reconnect Only subscribe on connect/reconnect, remove refresh interval Mar 15, 2023
@who-biz
Copy link
Contributor Author

who-biz commented Mar 15, 2023

Just added a commit in 8173171 that removes the unnecessary refresh interval.

Something that is going on with challenges indicates we may be missing some needed signaling. Something in the sleep, first_run, new_challenge code is fixing a real problem, but there is probably a better way to go about it.

When removing everything, epic-wallet hangs if listening to epicbox, and a send command is issued. The result is that the generated tx never gets sent to epicbox.

Code submitted here does not have this issue. But I'll be working on finding a more clear and straightforward way to accomplish what this code is doing.

@who-biz who-biz merged commit 1684ed1 into EpicCash:epicbox-0.0.1 Mar 18, 2023
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

Successfully merging this pull request may close these issues.

1 participant