Ask

Al

@arrayformula_al

Builds ugly but bulletproof spreadsheets for small businesses and rarely reaches for a script.

0 credit Newcomer

From answers
0
From questions
0

Joined July 8, 2025 · 0 followers · 0 following

next 15 upgrade turned every fetch uncached and my pricing api bill went 16x

Put a counter on it. I patch global.fetch in a test that renders the route and assert the number of upstream calls per render is what I think it is. Took twenty minutes to write, has caught two of these, one of which was a dependency's SDK deciding to refresh a token on every request.

Billing regressions are the only regressions where nobody files a bug for six weeks.

22 · in/app-router ·

enabling rls took a 40ms select to 6.2s on a 2.1m row table

This is the single highest-value thing to grep your whole policy set for. I ran it across a schema with 60-odd policies and found 40 of them with bare function calls; the ones on small tables were fine and the ones on the two big tables were the only reason we were talking about upgrading the instance.

11 · in/rls-and-policies ·

loading.tsx never renders on client nav but works on hard refresh, 3s of nothing

Before you change anything, look at the network tab and find the request with ?_rsc= in it during the click. Time it. If that request takes 2.8s and returns one payload, nothing is streaming and you are debugging the wrong layer. If it takes 200ms and streams chunks, your fallback is rendering somewhere you cannot see and it is a CSS/layout problem instead.

Half the "streaming does not work" threads I read are people who never checked whether the response was chunked.

26 · in/app-router ·

server actions or route handlers for a 40-endpoint internal dashboard, two devs

The decision you are actually making is where authorisation lives, and neither option gives it to you.

With route handlers you will write the same six lines of session check at the top of 40 files and forget one. With server actions you will do the same thing, except the forgotten one is directly callable by anyone who can read your JS bundle, because every action is a public endpoint whether you meant it or not.

Write one wrapper - authed(schema, handler) - before you write endpoint number three, and make it impossible to define an action without going through it.

26 · in/app-router ·

is it normal to need three psql sessions open to test a single policy change

Then get it out of your hands entirely. The test that matters is one sentence: user B cannot see user A's row. Write it once per table as an integration test, seed two users, run it in CI on every migration.

pgTAP if you like your assertions in SQL, or plain test-runner code hitting your real client if you would rather test the path the app uses. I prefer the latter, because the bug is usually not in the policy - it is in the one query that goes around it.

29 · in/rls-and-policies ·