-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Notification migration #2063
base: main
Are you sure you want to change the base?
Notification migration #2063
Conversation
cf83376
to
f53fa31
Compare
19e7c42
to
a28bfab
Compare
src/datasources/notifications/entities/__tests__/notification-devices.entity.db.builder.ts
Show resolved
Hide resolved
src/datasources/notifications/entities/__tests__/notification-subscription.entity.db.builder.ts
Show resolved
Hide resolved
src/datasources/notifications/entities/__tests__/notification-subscription.entity.db.builder.ts
Outdated
Show resolved
Hide resolved
src/datasources/notifications/entities/__tests__/notification-subscription.entity.db.builder.ts
Show resolved
Hide resolved
src/datasources/notifications/entities/notification-devices.entity.db.ts
Outdated
Show resolved
Hide resolved
import { z } from 'zod'; | ||
|
||
export const UpsertSubscriptionsDtoSafeSchema = z.object({ | ||
chainId: z.string(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
chainId: z.string(), | |
chainId: NumericStringSchema, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of my comments can be tackled in a follow up as they are validation focused. I would suggest we add schema tests for those implemented here as well.
src/datasources/notifications/entities/__tests__/notification-devices.entity.db.builder.ts
Show resolved
Hide resolved
src/datasources/notifications/entities/__tests__/notification-subscription.entity.db.builder.ts
Show resolved
Hide resolved
src/datasources/notifications/entities/notification-devices.entity.db.ts
Outdated
Show resolved
Hide resolved
src/datasources/notifications/entities/notification-subscription.entity.db.ts
Outdated
Show resolved
Hide resolved
src/datasources/notifications/entities/notification-devices.entity.db.ts
Outdated
Show resolved
Hide resolved
src/domain/notifications/v2/notifications.repository.integration.spec.ts
Show resolved
Hide resolved
bb16bc1
to
5fc9e0b
Compare
src/domain/notifications/v2/test.notification.repository.interface.ts
Outdated
Show resolved
Hide resolved
const safeV2: { | ||
authPayload: AuthPayload; | ||
upsertSubscriptionsDto: UpsertSubscriptionsDto & { | ||
safes: Array<UpsertSubscriptionsSafesDto>; | ||
signature: `0x${string}`; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we extract this to a type, instead of typing it inline?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I totally agree. Since we usually define types inline, I did it this way to keep it consistent. Do you think we should consider creating an external type for it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should be able to extract this type from the controller using utility types, therefore keeping the controller as the SSOT.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we discussed, I find heavy use of utility types makes the code extremely hard to read. However, I’d be happy to make the change if you could provide a code snippet as an example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No strong opinion here, but I'd prefer to use utility types so we can have a SSOT as Aaron suggests 🙂 Feel free to keep the current implementation if you prefer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
5e5999d
src/routes/notifications/v1/entities/__tests__/safe-registration.builder.ts
Show resolved
Hide resolved
src/routes/notifications/v1/entities/__tests__/register-device.dto.builder.ts
Show resolved
Hide resolved
15978c2
to
73984fe
Compare
037b635
to
e6128ff
Compare
…rated to TypeORM.
…tests after enabling V2
…tionNotificationTypes
855d848
to
156d8e4
Compare
Summary
Add compatibility between Notification V1 and Notification V2. Integrate Notification V2 methods into Notification V1 to begin populating the database in advance of the data migration, ensuring clients can transition to V2 seamlessly without any changes on their end.
Changes