TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

A heck of a wild bug chase

66 pointsby togakangaroo9 months ago

8 comments

jof9 months ago
It seems to me like the underlying issue was ignoring HTTP semantics and making a state-changing link like a logout link a plain &lt;a&gt; (HTTP GET) and not something like a form submission (HTTP POST).<p>Having intuition for the foundational layers of our tools saves so much time and future headaches.
评论 #41205742 未加载
评论 #41205466 未加载
评论 #41204754 未加载
评论 #41204727 未加载
hschne9 months ago
&gt; I didn’t want to deal with databases.<p>So instead I used a third party authentication service, store some data in JSON files, and also threw up a lamda gateway to store some more data in Google Sheets?<p>It&#x27;s not relevant to the bug hunt, but I&#x27;m genuinely intrigued. Is this approach considered easier to work with than using a regular ol&#x27; DB?
评论 #41208995 未加载
williamdclt9 months ago
&gt; It is wild how decisions made in one part of a technical stack can manifest at another point in time, in another place in the stack, and in such a convoluted manner.<p>While this isn&#x27;t something that _only_ happens in modern javascript, it certainly is a pattern. These bugs are convoluted and difficult to debug because the technologies are convoluted, stacked on top of each other compounding the bugs, and devs do not understand the underlying platform.<p>Honestly, it&#x27;s once-again a good case study for why I&#x27;d stay from NextJS or &quot;modern JS&quot; devs (despite being in this ecosystem myself, Node&#x2F;React&#x2F;RN):<p>- NextJS, one of the most modern techs in wide use, makes debugging _harder_ than vanilla JS?? This is crazy - Reimplementing browser behaviour in JS is _exactly_ what I would expect to be the root cause of various difficult-to-debug-and-to-fix bugs down the line - Using GET for a logout is a misunderstanding of HTTP semantics. This could have broken in other ways (eg integrating turbolinks in the app).<p>Well done for debugging and fixing this, but honestly... this doesn&#x27;t speak to the strength of the technology choices or the author&#x27;s understanding of the platform
andrewfromx9 months ago
I always do &lt;a href=&quot;#&quot; id=&quot;logout&quot;&gt;logout&lt;&#x2F;a&gt; so there is no url to accidentally GET call anyways.
评论 #41205746 未加载
评论 #41206239 未加载
danjl9 months ago
Authentication is a major hurdle. Back in the days of desktop software, there was no authentication. Mobile apps can often avoid authentication too. Despite decades of web coding, and lots of &quot;this authentication system will make life easy&quot; claims, it is still hard and easy to mess up.
评论 #41207219 未加载
throw1567542289 months ago
OP learnt about idempotency in http the hard way. However the post reminded me that I don&#x27;t particularly like this hydration step of NextJS apps where there is javascript executing that is difficult if not impossible to step debug.
langsoul-com9 months ago
So would this simply work if the Link component from nextjs wasn&#x27;t used?
评论 #41208777 未加载
realxrobau9 months ago
So, in summary, because you added a whole bunch of stuff that didn&#x27;t need to be there, it broke. Colour me surprised.<p>It sounds like this could be implemented almost completely without any of that, especially as you were using JavaScript for the data.<p>All I can hope is that you&#x27;ve learnt a lesson about unnecessary overcomplication.