Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove errorneous error logging and db inserts in group experiment assign call #2148

Merged
Merged
Changes from 2 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
Original file line number Diff line number Diff line change
Expand Up @@ -863,36 +863,11 @@ export class ExperimentAssignmentService {
});
}

// exclude experiments which are not previously assigned and throw error
// exclude experiments which are not previously assigned
const experimentToExclude = experiments.filter((experiment) => {
return groupExperimentAssignedIds.indexOf(experiment.id) === -1;
});

const experimentToExcludeIds = experimentToExclude.map((experiment) => experiment.id);

// throw error user group not defined and add experiments which are excluded
experimentToExclude.forEach(({ id, name }) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should keep the logger and comment out the insertion in the database.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it's not just the insert that is a problem, when i was testing this yesterday, the log and insert both are called for no reason for most users, regardless of if they have an invalid group or not.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

#2147 (comment) i can demonstrate this in my local in mtg

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

will spawn a ticket to revisit this to figure out what the correct warnings we actually value for the scenarios where there really is working-group / group metadata issues.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

logger.error({
message: `Experiment Id: ${id},
Experiment Name: ${name},
Group not valid for experiment user
`,
});
});
await this.errorService.create(
{
endPoint: '/api/assign',
errorCode: 417,
message: `Group not defined for experiment User: ${JSON.stringify(
{ ...experimentUser, experiment: experimentToExcludeIds },
undefined,
2
)}`,
name: 'Experiment user group not defined',
type: SERVER_ERROR.EXPERIMENT_USER_GROUP_NOT_DEFINED,
} as any,
logger
);
return experimentToExclude;
}

Expand Down
Loading