From 552a556a3e66e451ff2f8cb3d045f5ae32268b66 Mon Sep 17 00:00:00 2001 From: smarcet Date: Wed, 16 Sep 2026 15:30:05 -0300 Subject: [PATCH] fix(auth): default public_profile_allow_chat_with_me to true for new users Aligns the User entity constructor and Doctrine column mapping so both agree with the 2023 migration's DB-level default (1/true), closing the code/DB contradiction flagged in ClickUp 86bbdxzt6. Previously the constructor set false while the DB default was already 1, so new accounts silently diverged from the intended on-by-default chat setting once any code path relied on the DB default instead of the explicit ORM insert. Adds a unit test asserting a freshly constructed User defaults to chat-allowed true. --- app/libs/Auth/Models/User.php | 4 ++-- tests/unit/UserMappingTest.php | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/libs/Auth/Models/User.php b/app/libs/Auth/Models/User.php index c1d70d96..5f407abb 100644 --- a/app/libs/Auth/Models/User.php +++ b/app/libs/Auth/Models/User.php @@ -109,7 +109,7 @@ class User extends BaseEntity /** * @var bool */ - #[ORM\Column(name: 'public_profile_allow_chat_with_me', options: ['default' => 0], type: 'boolean')] + #[ORM\Column(name: 'public_profile_allow_chat_with_me', options: ['default' => 1], type: 'boolean')] private $public_profile_allow_chat_with_me; /** @@ -464,7 +464,7 @@ public function __construct() $this->public_profile_show_social_media_info = false; $this->public_profile_show_bio = true; $this->public_profile_show_telephone_number = false; - $this->public_profile_allow_chat_with_me = false; + $this->public_profile_allow_chat_with_me = true; $this->password = ""; $this->identifier = null; diff --git a/tests/unit/UserMappingTest.php b/tests/unit/UserMappingTest.php index add4d479..6dec45a9 100644 --- a/tests/unit/UserMappingTest.php +++ b/tests/unit/UserMappingTest.php @@ -29,6 +29,12 @@ */ class UserMappingTest extends BrowserKitTestCase { + public function testDefaultPublicProfileAllowChatWithMeIsTrue() + { + $user = new User(); + $this->assertTrue($user->isPublicProfileAllowChatWithMe()); + } + public function testUserPersistence() { $email = 'test@nomail.com';