Wire through a flag so that we can track when installations come from tests, and delete those from the DB more aggressively

This commit is contained in:
David Dworken
2023-10-15 13:09:48 -07:00
parent 449a4d0000
commit f3727dbeff
4 changed files with 12 additions and 4 deletions

View File

@ -83,7 +83,11 @@ func Setup(userSecret string, isOffline bool) error {
return nil
}
ctx := hctx.MakeContext()
_, err = ApiGet(ctx, "/api/v1/register?user_id="+data.UserId(userSecret)+"&device_id="+config.DeviceId)
registerPath := "/api/v1/register?user_id=" + data.UserId(userSecret) + "&device_id=" + config.DeviceId
if os.Getenv("HISHTORY_TEST") != "" {
registerPath += "&is_integration_test_device=true"
}
_, err = ApiGet(ctx, registerPath)
if err != nil {
return fmt.Errorf("failed to register device with backend: %w", err)
}