diff --git a/layer/utils/firestore.go b/layer/utils/firestore.go index 00d31f5..3a2e60a 100644 --- a/layer/utils/firestore.go +++ b/layer/utils/firestore.go @@ -60,7 +60,7 @@ func getLastDiff(client *firestore.Client, ctx context.Context, userId string, a func generateAndStoreDiff(client *firestore.Client, ctx context.Context, res Res, userId string, sessionId string) error { newDiff := resToDiff(res, userId) - _, err := client.Collection("users").Doc(userId).Collection("diffs").Doc("diff_"+userId).Set(ctx, newDiff) + _, _, err := client.Collection("profileDiffs").Add(ctx, diffToMap(newDiff)) if err != nil { return err } diff --git a/layer/utils/logging.go b/layer/utils/logging.go index 2251d74..3790519 100644 --- a/layer/utils/logging.go +++ b/layer/utils/logging.go @@ -18,6 +18,7 @@ func logProfileStored(client *firestore.Client, ctx context.Context, diff Diff, "sessionId": sessionId, }, Body: map[string]interface{}{ + "userId": userId, "profile": diffToMap(diff), }, } @@ -51,6 +52,7 @@ func LogHealth(client *firestore.Client, ctx context.Context, userId string, isS "sessionId": sessionId, }, Body: map[string]interface{}{ + "userId": userId, "serviceRunning": isServiceRunning, }, }