Server plugin looks scary

The user asked simply: "If full, new one rejected or old one die?" — The answer is: BOTH happen. The new one is rejected (error), AND old ones die (state corruption → wiped on next load/rebuild).

Let me be concise. Both — and it's worse than either. Here's the exact sequence in saveData (index.html:427-433):

state[0] = VERSION ✓ written state[1..4] = newLength ✓ written (header now claims the larger size) state.set(bytes, HDR) → throws RangeError (body never written)

So the header lies: it says "N bytes of JSON follow" but only the old (shorter) JSON is actually in state[5..]. On the next server rebuild (hibernation, crash, timeout — happens routinely), loadData reads the fake length, decodes past the real JSON into garbage, JSON.parse fails, and the catch returns {entries:[], reports:[]}.

Result:

New entry: rejected (connection closes 1011) Old entries: survive only in ephemeral cache until the server rebuilds, then entire directory wiped silently. So a full buffer doesn't just block new submissions — it corrupts and eventually destroys everything already stored.

-5 points · 1 comments · view on lemmy.world

1 Comments

ccufcc@lemmy.world · 1 pts · 25d

Sorry I think I misunderstood what server plugin does, it's an empty room(?) If you cram it and everything crumble it's your own fault.