Commit c4ab9501 authored by Andrei Mihu's avatar Andrei Mihu
Browse files

Add metrics for tracker presence event processing.

parent 591d8aaa
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr
- Fix log level in Lua runtime log calls which use logger fields.
- Correctly register purchase validation before/after hooks in JavaScript/Lua runtimes.
- Add missing "environment" to JS ValidatedPurchases results.
- Fix typos in error messages referencing empty input values.

## [3.5.0] - 2021-08-10
### Added
+3 −3
Original line number Diff line number Diff line
@@ -131,7 +131,7 @@ func (s *ApiServer) AddFriends(ctx context.Context, in *api.AddFriendsRequest) (

	for _, u := range in.GetUsernames() {
		if u == "" {
			return nil, status.Error(codes.InvalidArgument, "Username must not be emptypb.")
			return nil, status.Error(codes.InvalidArgument, "Username must not be empty.")
		}
		if username == u {
			return nil, status.Error(codes.InvalidArgument, "Cannot add self as friend.")
@@ -211,7 +211,7 @@ func (s *ApiServer) DeleteFriends(ctx context.Context, in *api.DeleteFriendsRequ
	username := ctx.Value(ctxUsernameKey{}).(string)
	for _, u := range in.GetUsernames() {
		if u == "" {
			return nil, status.Error(codes.InvalidArgument, "Username must not be emptypb.")
			return nil, status.Error(codes.InvalidArgument, "Username must not be empty.")
		}
		if username == u {
			return nil, status.Error(codes.InvalidArgument, "Cannot delete self.")
@@ -292,7 +292,7 @@ func (s *ApiServer) BlockFriends(ctx context.Context, in *api.BlockFriendsReques
	username := ctx.Value(ctxUsernameKey{}).(string)
	for _, u := range in.GetUsernames() {
		if u == "" {
			return nil, status.Error(codes.InvalidArgument, "Username must not be emptypb.")
			return nil, status.Error(codes.InvalidArgument, "Username must not be empty.")
		}
		if username == u {
			return nil, status.Error(codes.InvalidArgument, "Cannot block self.")
+2 −2
Original line number Diff line number Diff line
@@ -121,13 +121,13 @@ func (s *ApiServer) UpdateGroup(ctx context.Context, in *api.UpdateGroupRequest)

	if in.GetName() != nil {
		if len(in.GetName().String()) < 1 {
			return nil, status.Error(codes.InvalidArgument, "Group name cannot be emptypb.")
			return nil, status.Error(codes.InvalidArgument, "Group name cannot be empty.")
		}
	}

	if in.GetLangTag() != nil {
		if len(in.GetLangTag().String()) < 1 {
			return nil, status.Error(codes.InvalidArgument, "Group language cannot be emptypb.")
			return nil, status.Error(codes.InvalidArgument, "Group language cannot be empty.")
		}
	}

+4 −4
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ func (s *ApiServer) ValidatePurchaseApple(ctx context.Context, in *api.ValidateP
	}

	if len(in.Receipt) < 1 {
		return nil, status.Error(codes.InvalidArgument, "Receipt cannot be emptypb.")
		return nil, status.Error(codes.InvalidArgument, "Receipt cannot be empty.")
	}

	validation, err := ValidatePurchasesApple(ctx, s.logger, s.db, userID, s.config.GetIAP().Apple.SharedPassword, in.Receipt)
@@ -111,7 +111,7 @@ func (s *ApiServer) ValidatePurchaseGoogle(ctx context.Context, in *api.Validate
	}

	if len(in.Purchase) < 1 {
		return nil, status.Error(codes.InvalidArgument, "Purchase cannot be emptypb.")
		return nil, status.Error(codes.InvalidArgument, "Purchase cannot be empty.")
	}

	validation, err := ValidatePurchaseGoogle(ctx, s.logger, s.db, userID, s.config.GetIAP().Google, in.Purchase)
@@ -168,11 +168,11 @@ func (s *ApiServer) ValidatePurchaseHuawei(ctx context.Context, in *api.Validate
	}

	if len(in.Purchase) < 1 {
		return nil, status.Error(codes.InvalidArgument, "Purchase cannot be emptypb.")
		return nil, status.Error(codes.InvalidArgument, "Purchase cannot be empty.")
	}

	if len(in.Signature) < 1 {
		return nil, status.Error(codes.InvalidArgument, "Signature cannot be emptypb.")
		return nil, status.Error(codes.InvalidArgument, "Signature cannot be empty.")
	}

	validation, err := ValidatePurchaseHuawei(ctx, s.logger, s.db, userID, s.config.GetIAP().Huawei, in.Purchase, in.Signature)
+1 −1
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ var (
	protojsonUnmarshaler = &protojson.UnmarshalOptions{
		DiscardUnknown: false,
	}
	metrics = NewMetrics(logger, logger, nil, cfg)
	metrics = NewLocalMetrics(logger, logger, nil, cfg)
	_       = CheckConfig(logger, cfg)
)

Loading