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

Deal with timed out/failed requests #265

Open
edditler opened this issue Nov 15, 2021 · 5 comments
Open

Deal with timed out/failed requests #265

edditler opened this issue Nov 15, 2021 · 5 comments

Comments

@edditler
Copy link
Contributor

When saving a note, one of the toolbar icons in the editor will turn into a checkmark - indicating success - even if the response was 500 or timeout.

Archivy should handle the responses to fetch calls correctly.

@edditler
Copy link
Contributor Author

It appears that fetch() times out after more than a minute in Chrome and Firefox, which seems way too long. I included a timeout function in edditler@e156b0a#diff-82dfc4e59d32f549c0c0f2d629c4205952911a4a80a26fb4a55ba7ce94e0f66bR286-R322 and will test this for some time.

@Uzay-G
Copy link
Member

Uzay-G commented Nov 16, 2021

Already handling responses where the response wasn't a 200 code is something I should have done already 😅. This is a good idea.

@Uzay-G
Copy link
Member

Uzay-G commented Nov 25, 2021

Do you have any code for this? otherwise i'll start working on it. This + hopefully I can build a new archivy-lite docker image (just ripgrep) and we can make a new release.

@edditler
Copy link
Contributor Author

edditler commented Nov 25, 2021

Already handling responses where the response wasn't a 200 code is something I should have done already

I didn't go through all the functions. I just included it for tags (https://github.com/edditler/archivy/blob/main/archivy/static/component/frontmatter_tags.js#L33-L47) and the content for now (https://github.com/edditler/archivy/blob/main/archivy/templates/dataobjs/show.html#L286-L327
)

Surprisingly, a timeout of 3s was not always long enough, and even with 10s, I get sporadic alerts. It's better to know than to accidentally close the tab, but it's not a great solution for the problem itself (that edits are easily lost).

@Uzay-G
Copy link
Member

Uzay-G commented Mar 20, 2022

e429e1c works on this

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