varabyte / kobweb

A modern framework for full stack web apps in Kotlin, built upon Compose HTML
https://kobweb.varabyte.com
Apache License 2.0
1.41k stars 64 forks source link

Multiple refreshes, then blank page - no 404 #87

Closed PXNX closed 2 years ago

PXNX commented 2 years ago

When loading a url such as http://localhost:8080/test-refresh - which does not exist in a given project - the page continuously refreshes for some time, after which a blank page appears.

Shouldn't this instead lead to a 404 status page immediately?

PXNX commented 2 years ago

Might be a bug aswell, seemed more like an improvement to me though ;)

PXNX commented 2 years ago

It seemingly refreshes forever in most cases.

bitspittle commented 2 years ago

Yes, invalid pages should 404!

bitspittle commented 2 years ago

I'll go ahead and and change this to a "bug" label, since I am pretty sure this was working at one point but broke at some point. But otherwise yeah it would have been an enhancement :)

Labels don't really matter too much at this point, since it's not too hard to manage all the open issues at this point.

bitspittle commented 2 years ago

I am able to reproduce this, thanks for filing. I think at some point I updated the "automatically reload when a page is recompiled" logic and must have broke this - it's getting confused and trying to reload repeatedly.

bitspittle commented 2 years ago

Hahaha it's not at all what I expected. I have a bad regex right now for parsing the URL, and your hyphen is confusing my (bad) code.

If you type http://localhost:8080/testrefresh it should behave correctly.

I will fix my URL parsing logic to be more correct. I should probably delegate to the URL class if I can and not try to reinvent the wheel.

bitspittle commented 2 years ago

Will be fixed in kobweb 0.7.11

PXNX commented 2 years ago

Hahaha it's not at all what I expected. I have a bad regex right now for parsing the URL, and your hyphen is confusing my (bad) code.

If you type http://localhost:8080/testrefresh it should behave correctly.

I will fix my URL parsing logic to be more correct. I should probably delegate to the URL class if I can and not try to reinvent the wheel.

Regex is wonderful😅