Skip to content

fix: propagate "reset all data" deletion to Firestore#38

Merged
Spe1977 merged 2 commits into
mainfrom
claude/firebase-data-reset-sync-fOJuQ
May 30, 2026
Merged

fix: propagate "reset all data" deletion to Firestore#38
Spe1977 merged 2 commits into
mainfrom
claude/firebase-data-reset-sync-fOJuQ

Conversation

@Spe1977

@Spe1977 Spe1977 commented May 30, 2026

Copy link
Copy Markdown
Owner

The "RESETTA TUTTI I DATI" action only wiped local state, so for
authenticated users the realtime onSnapshot listeners restored every
deleted shift on the next reload.

  • FirestoreUserDataService.clearShiftData(uid): batch-delete only the
    shiftSeries/manualShifts/shiftOverrides collections (devices, profile
    and settings are left intact).
  • UserDataService.clearAll(): clear local state, then delete cloud shift
    data when authenticated.
  • ShiftService.deleteAllShifts(): route through clearAll() instead of a
    local-only setState.

Adds unit tests for both new methods. Full Jest suite 689/689, lint and
build green.

https://claude.ai/code/session_01Ve2drUzs5T985QJLCUdS7Z

claude added 2 commits May 30, 2026 17:24
The "RESETTA TUTTI I DATI" action only wiped local state, so for
authenticated users the realtime onSnapshot listeners restored every
deleted shift on the next reload.

- FirestoreUserDataService.clearShiftData(uid): batch-delete only the
  shiftSeries/manualShifts/shiftOverrides collections (devices, profile
  and settings are left intact).
- UserDataService.clearAll(): clear local state, then delete cloud shift
  data when authenticated.
- ShiftService.deleteAllShifts(): route through clearAll() instead of a
  local-only setState.

Adds unit tests for both new methods. Full Jest suite 689/689, lint and
build green.

https://claude.ai/code/session_01Ve2drUzs5T985QJLCUdS7Z
The reset-propagation fix (e550312) shipped without the unit tests its
message claimed. Add them:

- UserDataService.clearAll(): clears local state and deletes cloud shift
  data when authenticated; clears local only in guest mode.
- FirestoreUserDataService.clearShiftData(): batch-deletes only the three
  shift collections, leaving devices/profile/settings intact.

Full Jest suite 687 passed / 2 skipped.

https://claude.ai/code/session_01Ve2drUzs5T985QJLCUdS7Z
@Spe1977 Spe1977 merged commit b4ce8d7 into main May 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants