-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
SvelteKit demo app 'todos' failing on delete #1564
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
Comments
Had some difficulty reproducing this bug until I double clicked the delete icon. Able to reproduce it with a single item.
Found another similar bug in the TODO page:
|
I think the problem lies with the API server: We can see the issue by using
|
I also feel like a local store (file or sqlite) might be desirable. It can also demonstrate the ability for SvelteKit to function as a HTTP server (I think it already does in the current form but it's still ultimately relying on some external HTTP service). If people think that is a desirable change, I can help to implement that. |
Opened the PR above, which simply disables the delete button while the delete request is in flight. Should get rid of this issue. |
Please reopen this issue...PR 2172 is great, because it avoids a double-submit issue, but it does not fix the root problem. The root problem is with the (eventually) consistency of the API (api.svelte.dev). The bug can occur when clicking the delete button just once. (Note: Very tricky, because it doesn't fail consistently.) Method 1 (for triggering bug):
Method 2 (for triggering bug):
Method 3 (for triggering bug):
This demonstrates the issue, by creating a few todos and reloading them three times. To be clear: This is not a bug in the demo app, and it's not a bug in SvelteKit. This is a bug with the API server that is storing the todos. But it certainly needs to be addressed, because it makes SvelteKit look broken. FWIW: Method 2 and 3 were the most reliable ways to reproduce the bug -- for me at least 🤷 |
Thanks for the investigation @twobitfool! Perhaps it's better if we move this to https://github.com/sveltejs/api.svelte.dev then |
@ignatiusmb -- Yeah. That's an option. ...or option 2... We tweak the demo app to use local (or in-memory) storage, which would:
|
Some notes from when we created the demo: We have deployed versions of the demo apps (example) so wanted a real backend Vercel was doing some kind of caching that was originally causing issues on the Vercel deployed version. I think that was possibly turned off and wouldn't explain any issues occurring locally KV has a limit of 1 write per second per key. This app has all user todos living under If consistency is an issue, Durable Objects or Fauna would be strongly consistent (perhaps higher latency as a result) |
@twobitfool Yeah, looks like the API itself has some weird consistency issues. This seems to be about just that: sveltejs/api.svelte.dev#8 @benmccann Can you elaborate on what you mean by this?
What is the benefit vs using local storage? Is it because it's an example that new users might want to look at to learn how to interact with API's or something else? |
Please give this issue a higher priority, the todos part of the demo has been broken since basically forever. First impression matters. I second @twobitfool 's suggestion above to use local or in-memory storage. |
The reason localStorage or anything JavaScript-in-the-browser-related isn't used is to show progressive enhancement capabilities: The TODO list functions even if you block JavaScript from executing on the page. Adding something browser-JavaScript-related would make that impossible. |
@dummdidumm Agreed. It shouldn't be in-browser. I should have been more clear before... When I mentioned memory or local storage, I didn't mean browser memory or |
I was checking out sveltekit today and the laggy experience of the todos page put me off. After changing it to an in memory store in /todos/index.ts the response times of the api requests went from 300+ ms to ~5ms. I think this should be the default experience for new sveltekit users. If the external api todos page is needed for showing features of sveltekit, I would suggest to make two todos pages (one with in memory and one with external api). |
I just wanted to comment here that I almost quit investing more time into SvelteKit because the Todo's really seem slow and wonky. I can just click randomly on the Todo's until it 'breaks'. I don't know, it's just very bad/wonky UX. Seeing as it's one of the first thing new devs picking up Svelte will see, this is bad news. |
Describe the bug
The SvelteKit demo app seems to have a bug when deleting 'todos'. It occurs when multiple todos are added and subsequently deleted.
Logs
Server log has no error messages
To Reproduce
Perform the following steps (You may experience the error prior to completing all steps):
Expected behavior
TODO's are deleted when requested
Diagnostics
using Chrome (also fails using Firefox)
no adapter specified
Severity
Not severe. It may affect user perception of stability when evaluating SvelteKit.
Additional context
Failure is also present when running on Windows.
The text was updated successfully, but these errors were encountered: