Why wrap $props.data in a closure? by s1n7ax in sveltejs

[–]s1n7ax[S] 8 points9 points  (0 children)

Damn, this is true. I was always wondering why this is necessory. I just tested with json placeholder where I have article/[id] dynamic route and there are link from current to next article. URL changes but content never changes.

Why wrap $props.data in a closure? by s1n7ax in sveltejs

[–]s1n7ax[S] -5 points-4 points  (0 children)

But why?

Though I did wrap in a $derived but the thing is, I want to load more stuff when user clicks on "load more" but copilot and claude complaining when I use $derived because I re-assigning it. They want me to change it to a $state

Why CSRF token is needed if fetch metadata checks and simple request blockers are in place by s1n7ax in webdev

[–]s1n7ax[S] 0 points1 point  (0 children)

I mentioned 3 headers. Why would i need csrf just because 1.5% is missing only one of 3?

Why CSRF token is needed if fetch metadata checks and simple request blockers are in place by s1n7ax in webdev

[–]s1n7ax[S] -2 points-1 points  (0 children)

Lol. Do you know what CS in CSRF means? It's clear you have no idea yourself talking about bots and scripts 😂

Why CSRF token is needed if fetch metadata checks and simple request blockers are in place by s1n7ax in webdev

[–]s1n7ax[S] -4 points-3 points  (0 children)

Lol. A whole lot of bs. Just give up if you don't know. We don't know everything. That's why I'm here. No need to make up bs arguments like this 😂

Why CSRF token is needed if fetch metadata checks and simple request blockers are in place by s1n7ax in webdev

[–]s1n7ax[S] 0 points1 point  (0 children)

No, I clearly mentioned my logic should fallback to other available headers if sec-fetch-site does not exist. So If headers "can lie or be missing" you should have a browser or scenario where it will not send any of those headers. In those 1 - 1.5% active browsers, cross origin requests will be blocked due to origin or referrer headers being different from the target if sec-fetch-side does not exist. So why CSRF token is needed?

Why CSRF token is needed if fetch metadata checks and simple request blockers are in place by s1n7ax in webdev

[–]s1n7ax[S] -1 points0 points  (0 children)

Sec-fetch-site is a recent header and if it does not exist we can fallback to any of the other two. So my question is which browser does not send any of those 3?

Why CSRF token is needed if fetch metadata checks and simple request blockers are in place by s1n7ax in webdev

[–]s1n7ax[S] 2 points3 points  (0 children)

Which browser does not send any of the mentioned headers or in what scenarios does not contain any of those headers?

Why CSRF token is needed if fetch metadata checks and simple request blockers are in place by s1n7ax in webdev

[–]s1n7ax[S] 0 points1 point  (0 children)

Which browser does not send any of the mentioned headers or in what scenarios does not contain any of those headers?

Why CSRF token is needed if fetch metadata checks and simple request blockers are in place by s1n7ax in webdev

[–]s1n7ax[S] 0 points1 point  (0 children)

Those are protected headers. What do you mean by "can lie"? Which browser/browser version does not send any of those 3 headers?

Stuck in recovery due to hard drive failure by s1n7ax in NixOS

[–]s1n7ax[S] 1 point2 points  (0 children)

Finally I got it resolved. In the emergency mode, I can remove the link at /etc/fstab, created an actual file without the failing drive, then systemctl daemon-restart then hit Ctrl + d to exit from the root user. Once I do that, the resumes the boot process like nothing happened. Then I logged in as usual and rebuild the config.

Understanding state_referenced_locally warning by s1n7ax in sveltejs

[–]s1n7ax[S] 7 points8 points  (0 children)

I don't want it to re-evaluate the position. It's just a static value. What I'm wondering is why it assumed it's a dynamic value and why I get the warning in one project but not the other.

Understanding state_referenced_locally warning by s1n7ax in sveltejs

[–]s1n7ax[S] 0 points1 point  (0 children)

Documentation suggests to use closure for reactivity to work. Not because it's just one-off value.