Skip to content

Lock anonymized movements in movement list#674

Merged
rzueger merged 3 commits intodevelopfrom
claude/lock-anonymized-movements
Mar 25, 2026
Merged

Lock anonymized movements in movement list#674
rzueger merged 3 commits intodevelopfrom
claude/lock-anonymized-movements

Conversation

@rzueger
Copy link
Member

@rzueger rzueger commented Mar 25, 2026

Summary

  • Treat anonymized movement records as locked in the movement list
  • Admins see a lock icon and cannot edit/delete anonymized records
  • PII has been stripped by the retention job, making edits pointless and deletes would lose aggregate data

Test plan

  • Verify anonymized movements show lock icon and reduced opacity
  • Verify edit/delete/customs actions are hidden for anonymized movements
  • Verify non-anonymized movements are unaffected

https://claude.ai/code/session_01KHZDkEfyznUCcoGCWrGdsY

Treat anonymized records as locked so admins see a lock icon
and cannot edit or delete them. PII has been stripped by the
retention job, making edits pointless.

https://claude.ai/code/session_01KHZDkEfyznUCcoGCWrGdsY
@rzueger
Copy link
Member Author

rzueger commented Mar 25, 2026

@claude build is failing

@claude
Copy link

claude bot commented Mar 25, 2026

Claude finished @rzueger's task in 6m 0s —— View job


Build failure fixed

  • Gather context
  • Check CI status and logs
  • Identify the build error
  • Fix the issue
  • Push fix

Root cause: Two Cypress specs were failing with AssertionError: expected 2 to equal 1:

  • movements/arrival/create_arrival_spec.js
  • movements/departure/create_departure_spec.js

Both specs assumed an empty Firebase test database by checking Object.keys(departures).length === 1 after creating one movement. This creates a self-perpetuating failure: when the assertion throws, the key variable (createdDepartureKey / createdArrivalKey) is never assigned, so the after() cleanup is skipped, leaving a stranded record in the shared DB. The next run finds one pre-existing record, fails the same assertion, leaves another record, and so on.

Fix (commit bc6f275): Capture the set of existing keys in before() before filling the form, then diff against the post-submission snapshot to find the newly created key. This tolerates any pre-existing records and correctly identifies the one record created by the test.
|

Capture existing keys before form submission and diff against
the post-submission snapshot to find the newly created key.
This prevents self-perpetuating failures caused by leftover
records from previous failed runs.

Co-authored-by: Roli Züger <rzueger@users.noreply.github.com>
@rzueger
Copy link
Member Author

rzueger commented Mar 25, 2026

@claude remove the fix commit again from the branch. the cypress failures were caused by wrong test data in the database.

@claude
Copy link

claude bot commented Mar 25, 2026

Claude finished @rzueger's task in 1m 26s —— View job


Fix commit reverted

  • Gather context
  • Remove commit bc6f275 from branch
  • Push to remote

Reverted the changes from bc6f275 via commit a90389a. Both Cypress specs are back to their original form (simple expect(keys.length).to.equal(1) assertions).

This reverts commit bc6f275.
The cypress failures were caused by wrong test data in the database.
@rzueger rzueger merged commit 8d4d3f3 into develop Mar 25, 2026
2 checks passed
@rzueger rzueger deleted the claude/lock-anonymized-movements branch March 25, 2026 14:00
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