From e709ce03b441b79624bff129c9e564524315756b Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 25 Mar 2026 12:47:51 +0000 Subject: [PATCH 1/3] Lock anonymized movements in movement list 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 --- src/components/MovementList/MovementGroup.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/MovementList/MovementGroup.tsx b/src/components/MovementList/MovementGroup.tsx index 652187c1..96450db3 100644 --- a/src/components/MovementList/MovementGroup.tsx +++ b/src/components/MovementList/MovementGroup.tsx @@ -40,7 +40,7 @@ class MovementGroup extends React.PureComponent { timeWithDate={props.timeWithDate} createMovementFromMovement={props.createMovementFromMovement} onDelete={props.onDelete} - locked={isLocked(item, props.lockDate)} + locked={isLocked(item, props.lockDate) || item.anonymized === true} aircraftSettings={props.aircraftSettings} loading={props.loading} isAdmin={props.isAdmin} From bc6f275362fbc89924cd2e4f2d642658dcb84dc1 Mon Sep 17 00:00:00 2001 From: "claude[bot]" <41898282+claude[bot]@users.noreply.github.com> Date: Wed, 25 Mar 2026 13:11:36 +0000 Subject: [PATCH 2/3] Fix create movement specs to tolerate pre-existing DB records MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .../movements/arrival/create_arrival_spec.js | 14 +++++++++++--- .../movements/departure/create_departure_spec.js | 14 +++++++++++--- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/cypress/integration/movements/arrival/create_arrival_spec.js b/cypress/integration/movements/arrival/create_arrival_spec.js index 53ffcf42..a42e0637 100644 --- a/cypress/integration/movements/arrival/create_arrival_spec.js +++ b/cypress/integration/movements/arrival/create_arrival_spec.js @@ -15,10 +15,17 @@ describe('movements', () => { describe('arrival', () => { describe('create_arrival', () => { let createdArrivalKey; + let existingArrivalKeys = []; before(() => { cy.visit('#/arrival/new'); cy.login(); + cy.window().then(win => + win.firebase.getRef('/arrivals').once('value').then(snapshot => { + const existing = snapshot.val(); + existingArrivalKeys = existing ? Object.keys(existing) : []; + }) + ); }); after(() => { @@ -68,10 +75,11 @@ describe('movements', () => { cy.window().then(win => win.firebase.getRef('/arrivals').once('value').then(snapshot => { const arrivals = snapshot.val(); - const keys = Object.keys(arrivals); - expect(keys.length).to.equal(1); + const allKeys = Object.keys(arrivals); + const newKeys = allKeys.filter(k => !existingArrivalKeys.includes(k)); + expect(newKeys.length).to.equal(1); - createdArrivalKey = keys[0]; + createdArrivalKey = newKeys[0]; const movement = firebaseToLocal(arrivals[createdArrivalKey]); diff --git a/cypress/integration/movements/departure/create_departure_spec.js b/cypress/integration/movements/departure/create_departure_spec.js index c785ed26..55a3788a 100644 --- a/cypress/integration/movements/departure/create_departure_spec.js +++ b/cypress/integration/movements/departure/create_departure_spec.js @@ -15,10 +15,17 @@ describe('movements', () => { describe('departure', () => { describe('create_departure', () => { let createdDepartureKey; + let existingDepartureKeys = []; before(() => { cy.visit('#/departure/new'); cy.login(); + cy.window().then(win => + win.firebase.getRef('/departures').once('value').then(snapshot => { + const existing = snapshot.val(); + existingDepartureKeys = existing ? Object.keys(existing) : []; + }) + ); }); after(() => { @@ -72,10 +79,11 @@ describe('movements', () => { cy.window().then(win => win.firebase.getRef('/departures').once('value').then(snapshot => { const departures = snapshot.val(); - const keys = Object.keys(departures); - expect(keys.length).to.equal(1); + const allKeys = Object.keys(departures); + const newKeys = allKeys.filter(k => !existingDepartureKeys.includes(k)); + expect(newKeys.length).to.equal(1); - createdDepartureKey = keys[0]; + createdDepartureKey = newKeys[0]; const movement = firebaseToLocal(departures[createdDepartureKey]); From a90389a8783d3af9d27c3333babb9f0741682e0d Mon Sep 17 00:00:00 2001 From: "claude[bot]" <41898282+claude[bot]@users.noreply.github.com> Date: Wed, 25 Mar 2026 13:37:35 +0000 Subject: [PATCH 3/3] Revert "Fix create movement specs to tolerate pre-existing DB records" This reverts commit bc6f275362fbc89924cd2e4f2d642658dcb84dc1. The cypress failures were caused by wrong test data in the database. --- .../movements/arrival/create_arrival_spec.js | 14 +++----------- .../movements/departure/create_departure_spec.js | 14 +++----------- 2 files changed, 6 insertions(+), 22 deletions(-) diff --git a/cypress/integration/movements/arrival/create_arrival_spec.js b/cypress/integration/movements/arrival/create_arrival_spec.js index a42e0637..53ffcf42 100644 --- a/cypress/integration/movements/arrival/create_arrival_spec.js +++ b/cypress/integration/movements/arrival/create_arrival_spec.js @@ -15,17 +15,10 @@ describe('movements', () => { describe('arrival', () => { describe('create_arrival', () => { let createdArrivalKey; - let existingArrivalKeys = []; before(() => { cy.visit('#/arrival/new'); cy.login(); - cy.window().then(win => - win.firebase.getRef('/arrivals').once('value').then(snapshot => { - const existing = snapshot.val(); - existingArrivalKeys = existing ? Object.keys(existing) : []; - }) - ); }); after(() => { @@ -75,11 +68,10 @@ describe('movements', () => { cy.window().then(win => win.firebase.getRef('/arrivals').once('value').then(snapshot => { const arrivals = snapshot.val(); - const allKeys = Object.keys(arrivals); - const newKeys = allKeys.filter(k => !existingArrivalKeys.includes(k)); - expect(newKeys.length).to.equal(1); + const keys = Object.keys(arrivals); + expect(keys.length).to.equal(1); - createdArrivalKey = newKeys[0]; + createdArrivalKey = keys[0]; const movement = firebaseToLocal(arrivals[createdArrivalKey]); diff --git a/cypress/integration/movements/departure/create_departure_spec.js b/cypress/integration/movements/departure/create_departure_spec.js index 55a3788a..c785ed26 100644 --- a/cypress/integration/movements/departure/create_departure_spec.js +++ b/cypress/integration/movements/departure/create_departure_spec.js @@ -15,17 +15,10 @@ describe('movements', () => { describe('departure', () => { describe('create_departure', () => { let createdDepartureKey; - let existingDepartureKeys = []; before(() => { cy.visit('#/departure/new'); cy.login(); - cy.window().then(win => - win.firebase.getRef('/departures').once('value').then(snapshot => { - const existing = snapshot.val(); - existingDepartureKeys = existing ? Object.keys(existing) : []; - }) - ); }); after(() => { @@ -79,11 +72,10 @@ describe('movements', () => { cy.window().then(win => win.firebase.getRef('/departures').once('value').then(snapshot => { const departures = snapshot.val(); - const allKeys = Object.keys(departures); - const newKeys = allKeys.filter(k => !existingDepartureKeys.includes(k)); - expect(newKeys.length).to.equal(1); + const keys = Object.keys(departures); + expect(keys.length).to.equal(1); - createdDepartureKey = newKeys[0]; + createdDepartureKey = keys[0]; const movement = firebaseToLocal(departures[createdDepartureKey]);