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
Adding some communication between UI and backend to ensure sync at connection start #164
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Apokalip <simeon@manta.network>
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Kevingislason
previously approved these changes
Aug 10, 2022
Signed-off-by: Apokalip <simeon@manta.network>
Kevingislason
previously approved these changes
Aug 10, 2022
…at the start Signed-off-by: Apokalip <simeon@manta.network>
Apokalip
changed the title
Adding invoke to track when front end is ready
Adding some communication between UI and backend to ensure sync at connection start
Aug 18, 2022
Signed-off-by: Apokalip <simeon@manta.network>
Apokalip
force-pushed
the
Apokalip/freezing_bug_fix_invoke_sync
branch
from
August 18, 2022 14:44
e4b1d1c
to
2ac489a
Compare
Kevingislason
previously approved these changes
Aug 18, 2022
Apokalip
added
L-added
Changelog: add these changes to the `added` section of the changelog
A-ui
Area: Issues and PRs related to UI
labels
Aug 19, 2022
3 tasks
Signed-off-by: Apokalip <simeon@manta.network>
Kevingislason
previously approved these changes
Aug 24, 2022
Signed-off-by: Simeon Zahariev <43317481+Apokalip@users.noreply.github.com>
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
…b.com/Manta-Network/manta-signer into Apokalip/freezing_bug_fix_invoke_sync
bhgomes
added
L-fixed
Changelog: add these changes to the `fixed` section of the changelog
and removed
L-added
Changelog: add these changes to the `added` section of the changelog
labels
Aug 24, 2022
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
Kevingislason
approved these changes
Aug 24, 2022
bhgomes
approved these changes
Aug 24, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Apokalip simeon@manta.network
Add invoke and static bool to track when front end is ready.
Changing how connection event happens, so until now we were sending a single connect event when the back end was ready to connect. There are a few issues with that as Rust code in release would probably be faster than the JS code which may send the connect event before the UI is listening for it. This was happening in the Linux Freezing #91. There are Tauri issues from other devs with the same problem with syncing at the start of the App, but Tauri was just not planned to be used as this, as normally you can work with the UI without being fully in sync with the backend. In some of those issues Tauri devs mention they are working on a solution but for now we are using a normal pinging method. What we are changing is instead of sending connect event once, we start emitting continuously connection events until we get an answer from the UI, in this case invoking ui_connected() and tracking UI_CONNECTED state. If connected we stop emitting or if not we timeout of course.
This should work in all cases, as we know the UI will always wait at
manta-signer/ui/src/App.js
Line 26 in 3ba2a1e
Old:
This is caused by misuse of how Tauri works. In this case we are trying to control the UI from the "back-end". While you would want the Rust code to generate the Front end, but after that the front end needs to "control" the backend by invoking methods and reacting to events as a UI should. For now this will work properly as this is not a workaround. But if we want to scale this, it is recommended to be changed as mentioned above.fixes: #146
fixes: #91
Before we can merge this PR, please make sure that all the following items have been checked off:
CHANGELOG.md
and added the appropriatechangelog
label to the PR.Files changed
in the GitHub PR explorer.