localstorage
Technical notes on web development, DevOps, and AI integration.
3 articles
- 00:39frontend
React Duplicate Keys from localStorage: My Two-Layer Fix
Legacy localStorage ids collided in my React chat. Here is the reindex plus seeding fix that silenced the duplicate key error.
TL;DR: A React "duplicate key" warning came from legacy localStorage chat data holding duplicate turn ids, plus a counter effect that read stale values and minted collisions. The fix: reindex every restored turn to 0..n-1 and seed the next id inside the restore effect itself. Lesson: treat persisted data as untrusted and normalize it at the boundary.
#react#localstorage#typescript - 11:37tooling
DeepSeek Login Died Between Sessions. Three Scripts Fixed It.
Re-logging into DeepSeek via VNC every week got old. I transferred the whole session into Camofox instead: cookies, token, keepalive.
TL;DR: DeepSeek sessions in Camofox died because logging in means two layers: HttpOnly cookies and a localStorage userToken for Bearer API calls. Importing cookies alone patched half the state, so the login page persisted. Three scripts merge cookies into Playwright's storage-state.json, inject the wrapped token, and poll every five minutes to confirm the session.
#automation#playwright#deepseek - 20:07ai
The follow-up question my AI chat couldn't answer
Chat follow-up questions without server sessions: history lives in localStorage, gets resent per ask, and the backend rebuilds the prompt under a char budget.
#fastapi#llm#stateless