Compare commits

...

3 Commits

8 changed files with 15 additions and 54 deletions

2
.github/ci.env vendored
View File

@@ -28,3 +28,5 @@ AUTH_SERVER_ENCRYPTION_SERVER_KEY=1087415dfde3093797f9a7ca93a49e7d7aa1861735eb0d
VALET_TOKEN_SECRET=4b886819ebe1e908077c6cae96311b48a8416bd60cc91c03060e15bdf6b30d1f
SYNCING_SERVER_CONTENT_SIZE_TRANSFER_LIMIT=100000
HTTP_REQUEST_PAYLOAD_LIMIT_MEGABYTES=1

View File

@@ -71,6 +71,7 @@ jobs:
echo "REFRESH_TOKEN_AGE=10" >> packages/home-server/.env
echo "REVISIONS_FREQUENCY=2" >> packages/home-server/.env
echo "CONTENT_SIZE_TRANSFER_LIMIT=100000" >> packages/home-server/.env
echo "HTTP_REQUEST_PAYLOAD_LIMIT_MEGABYTES=1" >> packages/home-server/.env
echo "DB_HOST=localhost" >> packages/home-server/.env
echo "DB_PORT=3306" >> packages/home-server/.env
echo "DB_DATABASE=standardnotes" >> packages/home-server/.env

View File

@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.178.1](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.178.0...@standardnotes/auth-server@1.178.1) (2024-02-09)
### Bug Fixes
* allow expired offline subscriptions to receive dashboard emails ([#1041](https://github.com/standardnotes/server/issues/1041)) ([4fe8e9a](https://github.com/standardnotes/server/commit/4fe8e9a79f652f3e39608d6683cb17cc08bb8717))
# [1.178.0](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.177.20...@standardnotes/auth-server@1.178.0) (2024-01-19)
### Features

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/auth-server",
"version": "1.178.0",
"version": "1.178.1",
"engines": {
"node": ">=18.0.0 <21.0.0"
},

View File

@@ -89,42 +89,4 @@ describe('CreateOfflineSubscriptionToken', () => {
expect(domainEventFactory.createEmailRequestedEvent).not.toHaveBeenCalled()
expect(domainEventPublisher.publish).not.toHaveBeenCalled()
})
it('should not create an offline subscription token if email has a cancelled subscription', async () => {
offlineUserSubscriptionRepository.findOneByEmail = jest
.fn()
.mockReturnValue({ cancelled: true, endsAt: 100 } as jest.Mocked<OfflineUserSubscription>)
expect(
await createUseCase().execute({
userEmail: 'test@test.com',
}),
).toEqual({
success: false,
error: 'subscription-canceled',
})
expect(offlineSubscriptionTokenRepository.save).not.toHaveBeenCalled()
expect(domainEventFactory.createEmailRequestedEvent).not.toHaveBeenCalled()
expect(domainEventPublisher.publish).not.toHaveBeenCalled()
})
it('should not create an offline subscription token if email has an outdated subscription', async () => {
offlineUserSubscriptionRepository.findOneByEmail = jest
.fn()
.mockReturnValue({ cancelled: false, endsAt: 2 } as jest.Mocked<OfflineUserSubscription>)
expect(
await createUseCase().execute({
userEmail: 'test@test.com',
}),
).toEqual({
success: false,
error: 'subscription-expired',
})
expect(offlineSubscriptionTokenRepository.save).not.toHaveBeenCalled()
expect(domainEventFactory.createEmailRequestedEvent).not.toHaveBeenCalled()
expect(domainEventPublisher.publish).not.toHaveBeenCalled()
})
})

View File

@@ -37,20 +37,6 @@ export class CreateOfflineSubscriptionToken implements UseCaseInterface {
}
}
if (existingSubscription.cancelled) {
return {
success: false,
error: 'subscription-canceled',
}
}
if (existingSubscription.endsAt < this.timer.getTimestampInMicroseconds()) {
return {
success: false,
error: 'subscription-expired',
}
}
const token = await this.cryptoNode.generateRandomKey(128)
const offlineSubscriptionToken = {

View File

@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.22.64](https://github.com/standardnotes/server/compare/@standardnotes/home-server@1.22.63...@standardnotes/home-server@1.22.64) (2024-02-09)
**Note:** Version bump only for package @standardnotes/home-server
## [1.22.63](https://github.com/standardnotes/server/compare/@standardnotes/home-server@1.22.62...@standardnotes/home-server@1.22.63) (2024-01-19)
**Note:** Version bump only for package @standardnotes/home-server

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/home-server",
"version": "1.22.63",
"version": "1.22.64",
"engines": {
"node": ">=18.0.0 <21.0.0"
},