-
Notifications
You must be signed in to change notification settings - Fork 312
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release' into 'master'
v4.4.2 See merge request passbolt/passbolt-ce-api!212
- Loading branch information
Showing
23 changed files
with
313 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,16 @@ | ||
Release song: https://youtu.be/RbmS3tQJ7Os?si=lp8QM5B-R65C8Jek | ||
Release song: https://youtu.be/6JNwqRF32ZI | ||
|
||
Passbolt v4.4.1 is a maintenance release aimed at addressing issues reported by the community, which were introduced in the previous release. | ||
Passbolt version 4.4.2 has been released, primarily as a maintenance update to address specific issues reported by users. This version includes two main fixes. | ||
|
||
The update addresses an issue concerning user roles in email notifications. Previously, administrators received notifications when another administrator was deleted. However, the deletion of any user, regardless of their administrator status, was incorrectly reported as an administrator deletion. This issue has been resolved. | ||
The first fix concerns the Time-based One-Time Password (TOTP) feature. In the previous version, there was an issue where users could accidentally delete the TOTP secret for a resource while editing its description from the sidebar. This has been corrected in the latest update. | ||
|
||
We extend our gratitude to the community members who reported these issues. Your support and patience are greatly appreciated. | ||
The second fix improves the performance of the application, specifically when users are retrieving their resources. This update is part of an ongoing effort to enhance the overall performance of the application, with further improvements planned for future releases. | ||
|
||
## [4.4.1] - 2023-11-20 | ||
We extend our gratitude to the community member who reported this issue. | ||
|
||
## [4.4.2] - 2023-11-28 | ||
### Improved | ||
- PB-28521 Alter the gpgkeys.uid column length to 769 to enable the synchronisation of user with very long names | ||
- PB-27616 As a user I should see improved performances when retrieving resources on the GET resources.json entry point | ||
|
||
### Fixed | ||
- PB-27957 As an administrator I should be notified that an administrator was deleted only when an administrator has been deleted, and not a regular user | ||
|
||
### Maintenance | ||
- PB-27927 Remove unused user_agents table | ||
- PB-28616 Refactor the email digest plugin code for easier usage and maintainability | ||
- PB-28991 As a user emails should be resent if the first attempt failed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,10 +24,12 @@ | |
use App\Test\Factory\UserFactory; | ||
use App\Test\Lib\AppIntegrationTestCase; | ||
use App\Test\Lib\Utility\EmailTestTrait; | ||
use App\Utility\UuidFactory; | ||
use Cake\Chronos\Chronos; | ||
use Cake\Console\TestSuite\ConsoleIntegrationTestTrait; | ||
use Cake\I18n\I18n; | ||
use Cake\Mailer\Mailer; | ||
use Cake\Network\Exception\SocketException; | ||
use Passbolt\EmailDigest\Test\Factory\EmailQueueFactory; | ||
use Passbolt\EmailDigest\Test\Lib\EmailDigestMockTestTrait; | ||
use Passbolt\EmailDigest\Utility\Digest\DigestTemplateRegistry; | ||
|
@@ -124,17 +126,86 @@ public function testSenderCommandLocale() | |
$this->assertMailBodyStringCount(1, '</head>'); | ||
} | ||
|
||
public function testSenderCommand_NoRowsAreLockedWhenThresholdIsExceeded() | ||
public function noRowsLockedProvider(): array | ||
{ | ||
$nResourcesAdded = 15; | ||
$operator = UserFactory::make()->withAvatar()->persist(); | ||
return [ | ||
['single_email' => 1], | ||
['multiple_emails_in_digest' => 2], | ||
['threshold_exceeded' => 11], | ||
]; | ||
} | ||
|
||
/** | ||
* @dataProvider noRowsLockedProvider | ||
*/ | ||
public function testSenderCommand_EmailQueueRowsAreUnlockedAfterSuccessfulSend(int $nResourcesAdded) | ||
{ | ||
$operator = UserFactory::make()->withAvatar()->getEntity(); | ||
$recipient = '[email protected]'; | ||
EmailQueueFactory::make($nResourcesAdded) | ||
->setRecipient($recipient) | ||
->setTemplate(ResourceCreateEmailRedactor::TEMPLATE) | ||
->setField('template_vars.body.user', $operator) | ||
->setField('template_vars.body.resource', [ | ||
// Dummy data to render email without any warnings | ||
'id' => UuidFactory::uuid(), | ||
'created' => 'now', | ||
'name' => 'My pass', | ||
'secrets' => [['data' => 'foo bar baz']], | ||
]) | ||
->setField('template_vars.body.showUsername', false) | ||
->setField('template_vars.body.showUri', false) | ||
->setField('template_vars.body.showDescription', false) | ||
->setField('template_vars.body.showSecret', false) | ||
->persist(); | ||
|
||
$this->exec('passbolt email_digest send'); | ||
|
||
$this->assertExitSuccess(); | ||
$this->assertMailCount(1); | ||
$this->assertMailSentToAt(0, [$recipient => $recipient]); | ||
// Make sure email queue entries are not locked | ||
$count = EmailQueueFactory::find()->where(['locked' => true])->count(); | ||
$this->assertEquals(0, $count); | ||
// Make sure email queue entries are sent | ||
$count = EmailQueueFactory::find()->where(['sent' => true, 'locked' => false])->count(); | ||
$this->assertEquals($nResourcesAdded, $count); | ||
} | ||
|
||
/** | ||
* @dataProvider noRowsLockedProvider | ||
*/ | ||
public function testSenderCommand_EmailQueueRowsAreUnlockedAfterFailedSend(int $nResourcesAdded) | ||
{ | ||
$operator = UserFactory::make()->withAvatar()->getEntity(); | ||
$recipient = '[email protected]'; | ||
EmailQueueFactory::make($nResourcesAdded) | ||
->setRecipient($recipient) | ||
->setTemplate(ResourceCreateEmailRedactor::TEMPLATE) | ||
->setField('template_vars.body.user', $operator) | ||
->setField('template_vars.body.resource', [ | ||
// Dummy data to render email without any warnings | ||
'id' => UuidFactory::uuid(), | ||
'created' => 'now', | ||
'name' => 'My pass', | ||
'secrets' => [['data' => 'foo bar baz']], | ||
]) | ||
->setField('template_vars.body.showUsername', false) | ||
->setField('template_vars.body.showUri', false) | ||
->setField('template_vars.body.showDescription', false) | ||
->setField('template_vars.body.showSecret', false) | ||
->persist(); | ||
|
||
$mockedEmailQueue = $this->getMockForModel( | ||
'EmailQueue.EmailQueue', | ||
['success',], | ||
['table' => 'email_queue',] | ||
); | ||
$mockedEmailQueue | ||
->expects($this->once()) | ||
->method('success') | ||
->willThrowException(new SocketException()); | ||
|
||
$this->exec('passbolt email_digest send'); | ||
|
||
$this->assertExitSuccess(); | ||
|
@@ -143,6 +214,9 @@ public function testSenderCommand_NoRowsAreLockedWhenThresholdIsExceeded() | |
// Make sure email queue entries are not locked | ||
$count = EmailQueueFactory::find()->where(['locked' => true])->count(); | ||
$this->assertEquals(0, $count); | ||
// Make sure email queue entries are not sent | ||
$count = EmailQueueFactory::find()->where(['sent' => false, 'locked' => false])->count(); | ||
$this->assertEquals($nResourcesAdded, $count); | ||
} | ||
|
||
public function testSenderCommandMultipleDigests() | ||
|
@@ -174,6 +248,9 @@ public function testSenderCommandMultipleDigests() | |
$this->exec('passbolt email_digest send'); | ||
$this->assertExitSuccess(); | ||
|
||
$sentCount = EmailQueueFactory::find()->where(['sent' => true])->count(); | ||
$this->assertSame($nEmailsSent * 2, $sentCount); | ||
|
||
$this->assertMailCount(2); | ||
$subject = $user->profile->full_name . ' has made changes on several resources'; | ||
$this->assertMailSubjectContainsAt(0, $subject); | ||
|
Oops, something went wrong.