-
Notifications
You must be signed in to change notification settings - Fork 33
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
Sorted team list change broke team list #377
Comments
Could you send me more details about these DuplicateKeyExceptions? For instance, which query triggered them? What key was duplicated? |
Here's a stack. I think the key is the team id. System.ArgumentException: |
I think the last sql query before the exception is: SELECT [team].[ID], [team].[CustomRoom], [team].[EventID], [team].[HintCoinCount], [team].[HintCoinsUsed], [team].[IsLookingForTeammates], [team].[Name], [team].[PrimaryContactEmail], [team].[PrimaryPhoneNumber], [team].[RoomID], [team].[SecondaryPhoneNumber] FROM [Teams] AS [team] WHERE [team].[EventID] = @__Event_0_ID ORDER BY [team].[Name] |
I think the exception is from the second-to-last SQL query, so could you tell me that one? (I launch two SQL queries in parallel.) It looks like my first query creates a list of tuples with duplicate keys, so when that's converted to a dictionary it has duplicate keys. So maybe if I see that second-to-last SQL query I'll understand how my SQL intentions didn't get translated right. |
It's below. For future reference, the Visual Studio debugger output window also shows SQL queries as they run. SELECT [teamMember.Team].[ID], [teamMember.Team].[CustomRoom], [teamMember.Team].[EventID], [teamMember.Team].[HintCoinCount], [teamMember.Team].[HintCoinsUsed], [teamMember.Team].[IsLookingForTeammates], [teamMember.Team].[Name], [teamMember.Team].[PrimaryContactEmail], [teamMember.Team].[PrimaryPhoneNumber], [teamMember.Team].[RoomID], [teamMember.Team].[SecondaryPhoneNumber] FROM [Teams] AS [team] INNER JOIN [TeamMembers] AS [teamMember] ON [team].[ID] = ( SELECT TOP(1) [subQuery0].[ID] FROM [Teams] AS [subQuery0] WHERE [subQuery0].[ID] = [teamMember].[Team.ID] ) INNER JOIN [Teams] AS [teamMember.Team] ON [teamMember].[Team.ID] = [teamMember.Team].[ID] WHERE [team].[EventID] = @__Event_0_ID ORDER BY [teamMember.Team].[ID] |
Change #364 to sort the team list triggered DuplicateKeyExceptions on the live site. It might be a bug in the join when teams have more than one member. The change was backed out. @jaylorch , you might want to take another shot at this one.
The text was updated successfully, but these errors were encountered: