Skip to content

A platform for community discussion. Free, open, simple.

FEATURE: Upcoming change to lower the pending users reminder delay default (#42019)

Régis Hanol2937da0e36f3
diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml
index 372629ac3f9..f433b93c6fb 100644
--- a/config/locales/server.en.yml
+++ b/config/locales/server.en.yml
@@ -2976,6 +2976,7 @@ en:
granular_anonymous_and_logged_in_groups_permissions: "Makes group-based site setting permissions treat 'everyone' as 'all logged-in users', and enables the new 'anonymous_users' and 'logged_in_users' pseudogroups so admins can explicitly target anonymous visitors and authenticated users."
dashboard_improvements: "Enables the redesigned admin dashboard that lets you pin custom reports and includes improved site traffic, engagement, and other analytics tied to community success and value."
enable_invite_modal_with_roles: "Enables a redesigned invite flow that lets admins invite someone directly as an admin. The invitee becomes a moderator on signup and an admin once the inviter confirms via email."
+ update_pending_users_reminder_default: "We are updating the default for the {{setting:pending_users_reminder_delay_minutes}} setting to 30 minutes so that staff are promptly notified when a new member is waiting for approval. If you have previously changed this setting, this change will have no effect."
errors:
invalid_css_color: "Invalid color. Enter a color name or hex value."
diff --git a/config/site_settings.yml b/config/site_settings.yml
index 6bced848ec1..f35e4b5765e 100644
--- a/config/site_settings.yml
+++ b/config/site_settings.yml
@@ -981,6 +981,9 @@ login:
min: -1
default: 480
area: "login"
+ upcoming_change_default_override:
+ upcoming_change: "update_pending_users_reminder_default"
+ new_default: 30
persistent_sessions:
default: true
area: "login"
@@ -4821,3 +4824,14 @@ experimental:
status: "experimental"
impact: "feature,admins"
learn_more_url: "https://meta.discourse.org/t/-/407727"
+ update_pending_users_reminder_default:
+ default: false
+ hidden: true
+ client: true
+ upcoming_change:
+ status: "alpha"
+ impact: "site_setting_default,all_members"
+ learn_more_url: "https://meta.discourse.org/t/-/408429"
+ permanent_warning: false
+ allow_enabled_for:
+ - everyone
diff --git a/lib/upcoming_changes.rb b/lib/upcoming_changes.rb
index 41c5914a649..ef08744b39b 100644
--- a/lib/upcoming_changes.rb
+++ b/lib/upcoming_changes.rb
@@ -59,6 +59,13 @@ module UpcomingChanges
SiteSetting.enable_local_logins && SiteSetting.enable_local_logins_via_email &&
!SiteSetting.enable_discourse_connect
end
+
+ # Pending-user reminders only fire when must_approve_users is on, so the
+ # change is irrelevant elsewhere, including when enabled: the overridden
+ # default has no effect on a site where nobody can be pending.
+ def self.should_display_update_pending_users_reminder_default?
+ SiteSetting.must_approve_users
+ end
end
def self.user_enabled_reasons
diff --git a/spec/lib/upcoming_changes_spec.rb b/spec/lib/upcoming_changes_spec.rb
index 35b4e1a45d9..46ca20c7594 100644
--- a/spec/lib/upcoming_changes_spec.rb
+++ b/spec/lib/upcoming_changes_spec.rb
@@ -1366,5 +1366,35 @@ RSpec.describe UpcomingChanges do
).to eq(true)
end
end
+
+ describe ".should_display_update_pending_users_reminder_default?" do
+ it "returns false when must_approve_users is disabled" do
+ expect(
+ UpcomingChanges::ConditionalDisplay.should_display?(
+ :update_pending_users_reminder_default,
+ ),
+ ).to eq(false)
+ end
+
+ it "returns true when must_approve_users is enabled" do
+ SiteSetting.must_approve_users = true
+
+ expect(
+ UpcomingChanges::ConditionalDisplay.should_display?(
+ :update_pending_users_reminder_default,
+ ),
+ ).to eq(true)
+ end
+
+ it "returns false even when the change is enabled, since it has no effect without must_approve_users" do
+ SiteSetting.update_pending_users_reminder_default = true
+
+ expect(
+ UpcomingChanges::ConditionalDisplay.should_display?(
+ :update_pending_users_reminder_default,
+ ),
+ ).to eq(false)
+ end
+ end
end
end
diff --git a/spec/models/site_setting_spec.rb b/spec/models/site_setting_spec.rb
index ac8adc738d5..0cc2d0d276a 100644
--- a/spec/models/site_setting_spec.rb
+++ b/spec/models/site_setting_spec.rb
@@ -49,6 +49,25 @@ RSpec.describe SiteSetting do
end
end
+ describe "pending_users_reminder_delay_minutes" do
+ it "defaults to 30 while the update_pending_users_reminder_default change is enabled" do
+ expect(SiteSetting.pending_users_reminder_delay_minutes).to eq(480)
+
+ SiteSetting.update_pending_users_reminder_default = true
+ expect(SiteSetting.pending_users_reminder_delay_minutes).to eq(30)
+
+ SiteSetting.update_pending_users_reminder_default = false
+ expect(SiteSetting.pending_users_reminder_delay_minutes).to eq(480)
+ end
+
+ it "keeps a value an admin has set when the change is enabled" do
+ SiteSetting.pending_users_reminder_delay_minutes = 60
+
+ SiteSetting.update_pending_users_reminder_default = true
+ expect(SiteSetting.pending_users_reminder_delay_minutes).to eq(60)
+ end
+ end
+
describe "top_menu" do
describe "validations" do
it "always demands latest" do