diff --git a/mobile_verifier/migrations/38_radio_location_estimates.sql b/mobile_verifier/migrations/38_radio_location_estimates.sql index 6454a2c4e..9b1ec007e 100644 --- a/mobile_verifier/migrations/38_radio_location_estimates.sql +++ b/mobile_verifier/migrations/38_radio_location_estimates.sql @@ -6,7 +6,7 @@ CREATE TABLE IF NOT EXISTS radio_location_estimates ( hex BIGINT NOT NULL, grid_distance BIGINT NOT NULL, confidence DECIMAL NOT NULL, - invalided_at TIMESTAMPTZ DEFAULT NULL, + invalidated_at TIMESTAMPTZ DEFAULT NULL, inserted_at TIMESTAMPTZ DEFAULT now(), PRIMARY KEY (hashed_key) -); \ No newline at end of file +); diff --git a/mobile_verifier/src/radio_location_estimates.rs b/mobile_verifier/src/radio_location_estimates.rs index 9b679e2ee..f00bfb335 100644 --- a/mobile_verifier/src/radio_location_estimates.rs +++ b/mobile_verifier/src/radio_location_estimates.rs @@ -216,7 +216,7 @@ async fn invalidate_old_estimates( sqlx::query( r#" UPDATE radio_location_estimates - SET invalided_at = now() + SET invalidated_at = now() WHERE radio_key = $1 AND received_timestamp < $2; "#, @@ -284,8 +284,8 @@ pub async fn clear_invalided( sqlx::query( r#" DELETE FROM radio_location_estimates - WHERE invalided_at IS NOT NULL - AND invalided_at < $1 + WHERE invalidated_at IS NOT NULL + AND invalidated_at < $1 "#, ) .bind(timestamp) @@ -305,7 +305,7 @@ pub async fn clear_invalided( // FROM radio_location_estimates // WHERE radio_key = $1 // AND confidence >= $2 -// AND invalided_at IS NULL +// AND invalidated_at IS NULL // ORDER BY radius DESC, confidence DESC // "#, // ) diff --git a/mobile_verifier/tests/integrations/radio_location_estimates.rs b/mobile_verifier/tests/integrations/radio_location_estimates.rs index 87970c7f0..4c72e938f 100644 --- a/mobile_verifier/tests/integrations/radio_location_estimates.rs +++ b/mobile_verifier/tests/integrations/radio_location_estimates.rs @@ -190,9 +190,9 @@ fn compare_report_and_estimate( assert_eq!(report.report.estimates[0].confidence, estimate.confidence); if should_be_valid { - assert!(estimate.invalided_at.is_none()); + assert!(estimate.invalidated_at.is_none()); } else { - assert!(estimate.invalided_at.is_some()); + assert!(estimate.invalidated_at.is_some()); } } @@ -204,7 +204,7 @@ pub struct RadioLocationEstimateDB { pub hex: CellIndex, pub grid_distance: u32, pub confidence: rust_decimal::Decimal, - pub invalided_at: Option>, + pub invalidated_at: Option>, } pub async fn select_radio_location_estimates( @@ -232,7 +232,7 @@ pub async fn select_radio_location_estimates( hex, grid_distance: row.get::("grid_distance") as u32, confidence: row.get("confidence"), - invalided_at: row.try_get("invalided_at").ok(), + invalidated_at: row.try_get("invalidated_at").ok(), } }) .collect();