-
-
Notifications
You must be signed in to change notification settings - Fork 121
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
Modifying the data type being used for allChallenges in api_processor… #401
Modifying the data type being used for allChallenges in api_processor… #401
Conversation
… from array to object.
If possible, could we have screenshots that show the difference between the old and new approach? Possibly screenshots of the data and what is being processed. Also, is this a fix or possible fix? just so we have an idea on where we are in fixing the problem. |
FWIW, I asked OpenAI ChatGPT:
ChatGPT replied to me:
|
Hi @lloydchang thanks for your above comment. Me and @GuillermoFloresV are aware of the difference, we're still figuring out why it was needed / why it was working before and not now. |
@ngillux @GuillermoFloresV @theGaryLarson Circling back to 25c41fb I asked ChatGPT to diff the before and after from @theGaryLarson's change (detailed below): ChatGPT replied: The two code snippets you provided are almost identical. It seems like there might be some duplication in the code as both snippets share the same variable names and processing logic. The only difference between the two snippets is how First Snippet: let rawStudentSummary = props.studentData.map(studentJSON => {
// ... data processing logic using props.studentData as an array ...
});
const data = React.useMemo(
() => mapData(rawStudentSummary),
[rawStudentSummary]
); Second Snippet: let rawStudentSummary = Object.entries(props.studentData).map(([i]) => {
// ... data processing logic using props.studentData as an object ...
});
const data = mapData(rawStudentSummary); In the first snippet, Since the data processing logic is the same in both snippets, it seems that the second snippet is a more correct representation, assuming that the If there are other differences or specific issues you would like to clarify, please provide more context or details so that I can address them accordingly. I prompted ChatGPT to diff the before and after from @theGaryLarson's change:
|
@ngillux @GuillermoFloresV @theGaryLarson Based on the explanation from ChatGPT:
As for the question from @ngillux and @GuillermoFloresV :
My understanding is the difference in object casting. Previously, it was casted as an array of objects, hence :
Now, it's casted as an object, hence:
|
@lloydchang the response structure of the JSON data changed hence the differences in the two approaches. |
@ngillux Did the response structure change in a different pull request #366 from @theGaryLarson's #353? If yes, I believe the fundamental issue is what @theGaryLarson summarized yesterday, " Meanwhile, I submitted an issue request #403 for @GuillermoFloresV to Enable GitHub's Merge Queue for freeCodeCamp classroom GitHub repository to address the fundamental issue of asynchronous changes in pending PRs. Thank you! |
…rriculum data and removing redundant map iteration.
Answering my question to @ngillux earlier: I believe the response structure changed via freeCodeCamp/freeCodeCamp#50769 (review) and freeCodeCamp/freeCodeCamp#50955 Specifics are expanded at #410 (comment) |
… from array to object.
Checklist:
Update index.md
)Closes #400