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

Mentors that are also coordinators have incorrect initial matcher preferences #424

Open
smartspot2 opened this issue Jul 18, 2023 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers sev3 High severity - Production system impaired

Comments

@smartspot2
Copy link
Member

The matcher currently submits a GET request to fetch the matcher preferences for the current mentor to display in the mentor preference form:

for (const pref of jsonPreferences.responses) {
const slotIndex = newSlots.findIndex(slot => slot.id === pref.slot);
if (slotIndex !== -1) {
newSlots[slotIndex].preference = pref.preference;
}
}

However, if the user is also a coordinator, this result is actually the list of all preferences for all mentors, and these values end up overwriting each other, meaning the final preferences are (1) not the user's actual preferences, and (2) unpredictable, since it depends on the order of the response.

Further, if the user never actually submitted any preferences yet, the form also still be populated with other people's preferences.

A solution to this is to simply check for the mentor ID in the preference objects, and only save the preference if it matches the mentor's ID.

@smartspot2 smartspot2 added bug Something isn't working sev3 High severity - Production system impaired good first issue Good for newcomers labels Jul 18, 2023
@quesadas quesadas self-assigned this Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers sev3 High severity - Production system impaired
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants