Skip to content
This repository has been archived by the owner on Sep 19, 2023. It is now read-only.

Commit

Permalink
fix/mini-tracking (#255)
Browse files Browse the repository at this point in the history
* fix

* made
  • Loading branch information
decanus authored Apr 6, 2021
1 parent deeab04 commit 80765dc
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 29 deletions.
2 changes: 1 addition & 1 deletion pkg/pubsub/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ func NewRoomLinkShareEvent(user int, room string) Event {
}
}

func NewRoomOpenMiniEvent(user int, mini, room string) Event {
func NewRoomOpenMiniEvent(user, mini int, room string) Event {
return Event{
Type: EventTypeRoomOpenMini,
Params: map[string]interface{}{"id": user, "mini": mini, "room": room},
Expand Down
62 changes: 36 additions & 26 deletions pkg/rooms/pb/room.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/rooms/room.go
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ func (r *Room) onOpenMini(from int, mini *pb.Command_OpenMini) {

_ = r.queue.Publish(
pubsub.RoomTopic,
pubsub.NewRoomOpenMiniEvent(from, mini.Mini, r.id),
pubsub.NewRoomOpenMiniEvent(from, int(mini.Id), r.id),
)

resp, err := r.getMini(mini)
Expand Down
7 changes: 6 additions & 1 deletion pkg/tracking/trackers/mixpaneltracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,12 +220,17 @@ func transform(event *pubsub.Event) *tracking.Event {
return nil
}

mini, err := event.GetInt("mini")
if err != nil {
return nil
}

return &tracking.Event{
ID: strconv.Itoa(id),
Name: "room_open_mini",
Properties: map[string]interface{}{
"room_id": event.Params["room"],
"mini": event.Params["mini"],
"mini": mini,
},
}
case pubsub.EventTypeRoomLinkShare:
Expand Down

0 comments on commit 80765dc

Please sign in to comment.