-
Notifications
You must be signed in to change notification settings - Fork 282
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
fix!: replace StreamChatGenerics with module augmentation #2634
base: master
Are you sure you want to change the base?
Conversation
0a39de2
to
93b9d95
Compare
const options: ChannelOptions = { state: true, presence: true, limit: 10 }; | ||
const sort: ChannelSort = { last_message_at: -1, updated_at: -1 }; | ||
|
||
type LocalAttachmentType = Record<string, unknown>; |
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've yet to see a more beautiful sight than this :D
c5728f7
to
36c3dc3
Compare
Size Change: -249 B (-0.02%) Total Size: 1.37 MB
ℹ️ View Unchanged
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2634 +/- ##
==========================================
+ Coverage 81.03% 81.10% +0.07%
==========================================
Files 469 469
Lines 9929 9898 -31
Branches 2348 2344 -4
==========================================
- Hits 8046 8028 -18
+ Misses 1762 1748 -14
- Partials 121 122 +1 ☔ View full report in Codecov by Sentry. |
c9d1e66
to
3349707
Compare
export type StreamMessage = | ||
// FIXME: we should use only one of the two (either formatted or unformatted) | ||
(ReturnType<StreamChannelState['formatMessage']> | MessageResponse) & { | ||
customType?: string; | ||
errorStatusCode?: number; | ||
error?: ErrorFromResponse<APIErrorResponse>; | ||
editing?: boolean; | ||
date?: Date; | ||
}; |
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.
We should revisit StreamMessage
and decide what its shape should be as of a "local" message. In my opinion we should treat it as FormattedMessageResponse
with some extra properties (lines 31-35), which we sometimes add.
e3720c9
to
73f23f0
Compare
73f23f0
to
7d0a418
Compare
🎯 Goal
References: GetStream/stream-chat-js#1458
Notable changes:
EventComponentProps.message
property with{ event?: Event }
to cover for weird edge-caseStreamMessage
type with these properties commonly used across the SDK{ customType?: string; errorStatusCode?: number; editing?: boolean; date?: Date }