Skip to content

Commit

Permalink
[CHA-242] Adding new property to channel config (#291)
Browse files Browse the repository at this point in the history
* feat: adding new property to channel config

* fix: test
  • Loading branch information
totalimmersion authored Oct 28, 2024
1 parent 496be53 commit 832a851
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions channel_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ type ChannelConfig struct {
// Dynamic Partitioning
PartitionSize int `json:"partition_size,omitempty"`
PartitionTTL *DurationString `json:"partition_ttl,omitempty"`

SkipLastMsgUpdateForSystemMsgs bool `json:"skip_last_msg_update_for_system_msgs,omitempty"`
}

// DurationString is a duration that's encoded to as a string in JSON.
Expand Down
6 changes: 3 additions & 3 deletions message_history_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func TestMessageHistory(t *testing.T) {
initialText := "initial text"
customField := "custom_field"
initialCustomFieldValue := "custom value"
// send a message with initial text
// send a message with initial text (user1)
response, err := ch.SendMessage(ctx, &Message{Text: initialText, ExtraData: map[string]interface{}{customField: initialCustomFieldValue}}, user1.ID)
require.NoError(t, err)
message := response.Message
Expand Down Expand Up @@ -56,7 +56,7 @@ func TestMessageHistory(t *testing.T) {

secondUpdate := history[0]
assert.Equal(t, updatedText1, secondUpdate.Text)
assert.Equal(t, user2.ID, secondUpdate.MessageUpdatedByID)
assert.Equal(t, user1.ID, secondUpdate.MessageUpdatedByID)
assert.Equal(t, updatedCustomFieldValue, secondUpdate.ExtraData[customField].(string))
})

Expand Down Expand Up @@ -85,6 +85,6 @@ func TestMessageHistory(t *testing.T) {

secondUpdate := sortedHistory[1]
assert.Equal(t, updatedText1, secondUpdate.Text)
assert.Equal(t, user2.ID, secondUpdate.MessageUpdatedByID)
assert.Equal(t, user1.ID, secondUpdate.MessageUpdatedByID)
})
}

0 comments on commit 832a851

Please sign in to comment.