SShortSingh.
Back to feed

Use the existing session helper instead of fetching /me directly in feature pages

0
·3 views

A pull request adds a direct call to /api/me, a new useCurrentUser hook, or a raw token read from localStorage to get the signed-in user. The author argues the repository already has a session helper such as getSession, useAuth, or useSession that the rest of the UI relies on for user, loading, and signed-out states. Ad hoc calls can disagree with the header, handle token expiry differently, or skip the established error handling. The recommended approach is to treat one-off /me fetches in feature pages as a consistency bug and to extend the shared helper when new user fields are needed. Reviewers are advised to search diffs for such patterns and reject parallel session logic.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Proxmox VE Offers a Free Path to a Self-Hosted Private Cloud

A DevOps engineer argues that public cloud costs can balloon quickly, while self-hosting offers control over hardware, data location, and licensing. The article presents Proxmox VE, a Debian-based open-source hypervisor with KVM, LXC, ZFS, Ceph, clustering, and HA in one package, as a practical foundation for a private cloud. It stresses that a reliable setup requires at least three nodes, since two cannot maintain quorum during a failure. The author also recommends static management addresses, a dedicated low-latency network for cluster traffic, and rolling updates to avoid self-inflicted outages. Storage choices such as ZFS for local workloads are highlighted as central to the design's success.

0
ProgrammingDEV Community ·

Atom Zero 1.9.0 restores multi-turn conversation at a cost to single-turn accuracy

Atom Zero 1.9.0, a small 63M-parameter local model rather than a foundation model, is an update that recovers conversation handling previously lost during copy distillation while keeping the 1.8.0 copy profile. Multi-turn performance improved, with both-turns accuracy rising from 58.3% to 68.8%, and retention improved from 0.835 to 0.770. The trade-off is a 5.0-point drop in single-turn benign accuracy, from 99.2% to 94.2%. Copy accuracy on the seen 4-key set stayed roughly level at 59.5%, while the fresh unseen 4-key set rose to 67.0%. Safety and self-harm tests remained at full pass rates, and the model is released under Apache-2.0 with downloads on GitHub, PyPI, Hugging Face, and ModelScope.

0
ProgrammingDEV Community ·

StyleTry, Fashn and Kolors Compared: Which AI Virtual Try-On Tool Delivers

A comparison of three AI virtual try-on tools, StyleTry, Fashn and Kolors, finds that each serves a different need rather than one winning on every measure. StyleTry runs in the browser, lets shoppers pick from a large outfit gallery, and charges one credit per try-on. Fashn offers a broader platform with higher-resolution output and an API, and scored highest for garment fidelity in one independent test. Kolors is a free, account-free public demo whose image quality is strong but whose shared GPU queue can cause long waits and failed generations.

0
ProgrammingDEV Community ·

How to Verify Every Reference in Your Draft Before Submitting It

AI tools often generate references that look legitimate but do not exist, and a 2023 Scientific Reports study by Walters and Wilder reported that 55% of GPT-3.5 references were fabricated. This step-by-step guide explains how to check each reference in a draft using the Verital app, which searches CrossRef, OpenAlex, PubMed and DBLP. The tool gives an overall readiness verdict, flags references that cannot be found or have mismatched years, and checks claims against collected evidence. It also highlights references the writer has not read, encouraging verification of sources before submission. The walkthrough uses a four-reference example to demonstrate how blocking issues and warnings appear.