ULagos 360° protects your space-occupancy data with a two-layer automatic backup system. Every time a space status changes the current state is written toDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Pewiz/ulagos360/llms.txt
Use this file to discover all available pages before exploring further.
localStorage, and a full snapshot is taken on a 15-second interval. If the browser crashes, the tab is closed, or the device loses power mid-session, a tutor can recover the full spaces grid in a single click without contacting the server.
How Backups Are Written
TheusePersistentBackup hook manages all backup writes. It runs as a side-effect that reacts to every change in the Zustand spaces object and also registers lifecycle event listeners so the latest snapshot is always on disk before the page unloads.
updateSpace in spacesStore.js writes ulagos360_spaces_backup inline every time any single space is updated, giving per-change granularity between the 15-second ticks.
Backup Schedule
| Trigger | Key(s) written | Contents |
|---|---|---|
| Every space status change | ulagos360_spaces_backup | Full spaces object |
| Every 15 seconds (interval) | ulagos360_spaces_backup + ulagos360_emergency_backup | Spaces + ISO timestamp + version: "2.0" |
Page hide / tab switch (visibilitychange) | Both keys | Same as above |
Tab / window close (beforeunload) | Both keys | Same as above |
Manual Recovery
The recovery button appears in the header only whenspacesCount === 0 — that is, when the spaces grid is empty and there is likely backup data worth restoring.
Notice the empty spaces grid
If you open the app and the grid shows 0 spaces, or all spaces disappear
unexpectedly, this is the signal that a recovery may be needed.
Find the ↺ recovery button
Look for the RotateCcw (↺) icon button inside the user chip in the
header — it is displayed in yellow and only appears when
spacesCount === 0
and the onEmergencyRecover handler is available.Click to recover
Click the ↺ button. The
recoverFromBackup() function from
usePersistentBackup is called:Recovery Priority
The function always tries the most recent data source first:- Primary backup —
ulagos360_spaces_backup(plain spaces object, updated on every change) - Emergency backup —
ulagos360_emergency_backup(spaces + metadata, updated every 15 s and on page hide/unload) null— nothing was found; the grid remains empty and the server will provide the state on the next socket sync
The emergency backup includes a
timestamp (ISO 8601) and a version: "2.0"
field. If you need to debug a data-loss incident, open DevTools → Application
→ Local Storage and inspect ulagos360_emergency_backup to confirm exactly
when the last full snapshot was written.