Skip to content
This repository was archived by the owner on Jun 11, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion apps/websocket-server/internal/domain/logs/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type MsgData struct {
Cluster string `json:"cluster"`
TrackingId string `json:"trackingId"`
Since *string `json:"since,omitempty"`
RecordVersion int `json:"recordVersion"`
RecordVersion *int `json:"recordVersion"`
}

type Message struct {
Expand Down Expand Up @@ -101,5 +101,10 @@ func ParseSince(since *string) (*time.Time, error) {
}

func LogSubsId(md MsgData, logStreamName string) string {

if md.RecordVersion == nil {
return fmt.Sprintf("%s.%s.%s.%s.>", logStreamName, md.Account, md.Cluster, md.TrackingId)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question (typo): The format string ends with a >. If this is intentional, ensure that it aligns with the expected format for all consumers of this ID. If not, it might be a typo that could lead to inconsistencies in ID formatting.

}
Comment on lines +105 to +107
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (code_clarification): Consider adding a comment explaining why a nil RecordVersion leads to a different format in LogSubsId. This could help maintainers understand the business logic or technical reasons behind this decision.


return fmt.Sprintf("%s.%s.%s.%s.%d.>", logStreamName, md.Account, md.Cluster, md.TrackingId, md.RecordVersion)
}