7 Comments

ok, so I know it's been a bit since this article was created... but there's tons of typos and code errors. Yes, the github code is correct, but I was simply going down this walk-through and it caused me quite a bit of confusion for a little bit.

please fix?

Expand full comment
author

Sure, to save time, can you points out the most obvious ones?

Expand full comment
Mar 13Liked by Bite Code!

the only typo I noticed was in the code for server.py where you use todo.list_tides() instead of todo.list_todos() in a couple of places.

Expand full comment
author

I finally got the time to fix this, thanks. There were also some "tides" in the SQL statement, because my spellchecker decided "todos" was a typo.

Expand full comment

thanks for the great primer! this is probably a naive question but hoping you can answer. why does the state of checked vs non-checked stay consistent across browser refreshes even if I don't click the "Update" button? I see GET requests to for the index page when I refresh, but it something else cached? If I "hard refresh" I get back to the expected state for each item as represented in the DB

Expand full comment
author

The browser caches it because it doesn't want you to lose your form input if you refresh the page. They didn't do that 20 years ago, and you had to implement it manually. Most sites didn't, so you were filling you name and address for the bazillion times, and some stupid button reloaded the page and you lost everything.

So the browser vendors said "screw it" and did it themselves.

A clean implementation for the demo would force clear the cache on reload, but I didn't work to over complicate the first article, which is already quite long. And it's harder than it looks: browser caching is finicky.

Expand full comment

that makes perfect sense. thanks!!

Expand full comment