-
Notifications
You must be signed in to change notification settings - Fork 50.8k
ci: Fix excessively deep type instantiation in ChatHubMessageRepository
#22240
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
ci: Fix excessively deep type instantiation in ChatHubMessageRepository
#22240
Conversation
| async createChatMessage(message: Partial<ChatHubMessage>, trx?: EntityManager) { | ||
| async createChatMessage(message: QueryDeepPartialEntity<ChatHubMessage>, trx?: EntityManager) { | ||
| const messageId = message.id; | ||
| if (typeof messageId === 'function') { |
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.
The check is needed because QueryDeepPartialEntity allows every property to be either a value or (() => string) for SQL functions like NOW().
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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 issues found across 1 file
This comment has been minimized.
This comment has been minimized.
|
E2E Tests: n8n tests passed after 9m 16s Run Details
Groups
This message was posted automatically by
currents.dev | Integration Settings
|
mike12345567
left a comment
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.
LGTM - fixes the issue for me locally!
ChatHubMessagehas self-referencing bidirectional relations and, depending on the cache state, typechecking it may lead to TS2589. This fails specifically onentityManager.insertwhose arg type was fixed to break cycles, which indeed stopped them until now, so one theory is that TS is expanding self-references on checking assignability ofPartial<ChatHubMessage>(feature type) toQueryDeepPartialEntity<ChatHubMessage>(typeorm type).Let's validate the theory by aligning the types.