Merge commit 'fe7c6beb618da69da8d41dccd064dea1546bd391' into glitch-soc/merge-4.6

This commit is contained in:
Claire
2026-07-24 19:09:29 +02:00
4 changed files with 16 additions and 8 deletions
+3 -3
View File
@@ -100,7 +100,7 @@ GEM
attr_required (1.0.2)
aws-eventstream (1.4.0)
aws-partitions (1.1259.0)
aws-sdk-core (3.252.0)
aws-sdk-core (3.254.0)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.992.0)
aws-sigv4 (~> 1.9)
@@ -111,8 +111,8 @@ GEM
aws-sdk-kms (1.129.0)
aws-sdk-core (~> 3, >= 3.248.0)
aws-sigv4 (~> 1.5)
aws-sdk-s3 (1.225.1)
aws-sdk-core (~> 3, >= 3.248.0)
aws-sdk-s3 (1.228.1)
aws-sdk-core (~> 3, >= 3.254.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.5)
aws-sigv4 (1.12.1)
@@ -27,7 +27,7 @@ class Admin::Metrics::Measure::NewUsersMeasure < Admin::Metrics::Measure::BaseMe
WITH new_users AS (
SELECT users.id
FROM users
WHERE date_trunc('day', users.created_at)::date = axis.period
WHERE users.account_id >= (date_part('epoch', date_trunc('day', axis.period)::date) * 1000)::bigint << 16 AND users.account_id < ((date_part('epoch', date_trunc('day', axis.period)::date + ('1 day')::interval)) * 1000)::bigint << 16
)
SELECT count(*) FROM new_users
) AS value
+1 -1
View File
@@ -76,7 +76,7 @@ class Admin::Metrics::Retention
WITH new_users AS (
SELECT users.id
FROM users
WHERE date_trunc(:frequency, users.created_at)::date = axis.cohort_period
WHERE users.account_id >= (date_part('epoch', date_trunc(:frequency, axis.cohort_period)::date) * 1000)::bigint << 16 AND users.account_id < ((date_part('epoch', date_trunc(:frequency, axis.cohort_period)::date + ('1' || :frequency)::interval)) * 1000)::bigint << 16
),
retained_users AS (
SELECT users.id
@@ -12,9 +12,17 @@ RSpec.describe Admin::Metrics::Measure::NewUsersMeasure do
describe '#data' do
context 'with user records' do
before do
3.times { Fabricate :user, created_at: 2.days.ago }
2.times { Fabricate :user, created_at: 1.day.ago }
Fabricate :user, created_at: 0.days.ago
travel_to 2.days.ago do
# We specify the `id` because `travel_to` doesn't affect the database
3.times { Fabricate :account, id: Mastodon::Snowflake.id_at(Time.now.utc) }
end
travel_to 1.day.ago do
# We specify the `id` because `travel_to` doesn't affect the database
2.times { Fabricate :account, id: Mastodon::Snowflake.id_at(Time.now.utc) }
end
Fabricate :user
end
it 'returns correct user counts' do