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

Redundant and missing auto-save calls #113

Open
metanet opened this issue Jun 7, 2020 · 2 comments
Open

Redundant and missing auto-save calls #113

metanet opened this issue Jun 7, 2020 · 2 comments

Comments

@metanet
Copy link
Collaborator

metanet commented Jun 7, 2020

  1. Start pervane with debugging enabled.
  2. Open a tab in the browser.
  3. Type a single letter and wait for the auto-save trigger.
  4. See the following logs:
INFO:werkzeug:127.0.0.1 - - [07/Jun/2020 23:31:40] "POST /api/update HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [07/Jun/2020 23:31:40] "POST /api/update HTTP/1.1" 200 -

For each letter, there are 2 POST calls. If you type 5 letters and wait for the auto-save, there will be 10 POST calls.

On the other hand, if you delete something in the editor, auto-save doesn't get triggered.

Last, if you save by ALT+S, there is only 1 POST call which is the correct behavior.

@hakanu
Copy link
Owner

hakanu commented Jun 9, 2020

We listen to change event. And 2 seconds after event is triggered, pervane issues the POST request.

Deletion sounds like a bug. However, first one is the auto save behavior.

What do you recommend instead?

@metanet
Copy link
Collaborator Author

metanet commented Jun 10, 2020

but there are 2 POST requests for each key store. Why is there a second POST? It seems like a bug to me.

Other than that, I think hitting disk for each key stroke is a bit overkill. When I hit 5 keys in 2 seconds before auto-save kicks in, the UI sends 10 POST requests, even if a single POST request would be enough. I think we can optimize this part.

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

2 participants