-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
There appear to be multiple issues. I resolved one of them which was caused by a typo. There appear to be two issues remaining: - Sometimes, the server returns a 401. This could be a rate limit or an expired token? - The application still hangs but it happens after expanding a few more 'ArtistTree' components.
- Loading branch information
Showing
4 changed files
with
93 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
70f24deba8c25f3dbb107b88ef957d753887781f | ||
|
||
It appears as if the `action.payload` object has been corrupted somehow. | ||
|
||
### Notes | ||
|
||
- This is what it looks like in the console if I print it out: | ||
|
||
```none | ||
[ | ||
{ | ||
"id": "4RddZ3iHvSpGV4dvATac9X", | ||
"expand": false, | ||
"name": "Papa Roach", | ||
"relatedArtistIds": null, | ||
"4RddZ3iHvSpGV4dvATac9X": { | ||
"id": "4RddZ3iHvSpGV4dvATac9X", | ||
"expand": false, | ||
"name": "Papa Roach", | ||
"relatedArtistIds": null, | ||
"4RddZ3iHvSpGV4dvATac9X": { | ||
"id": "4RddZ3iHvSpGV4dvATac9X", | ||
"expand": false, | ||
"name": "Papa Roach", | ||
"relatedArtistIds": null, | ||
"4RddZ3iHvSpGV4dvATac9X": /* ... */ | ||
} | ||
} | ||
} | ||
]; | ||
``` | ||
- I tried converting the object to JSON to be able to put it here but I get this error: | ||
```none | ||
TypeError: Converting circular structure to JSON | ||
``` | ||
- The first thing that I notice is, that it can't create display the related artists. | ||
They appear in the `relatedArtistIds` of the `rootArtist` but they are not saved in `state.artists`. | ||
- I noticed that the `newArtists` that we compute in `LOAD_ARTISTS_IF_NOT_EXIST` is empty. | ||
### Ideas | ||
- Look for `{ [id]: "foo" }` in the codebase, that is where things could go wrong. | ||
- I suspect, that this is a nasty typo. | ||
### Solution | ||
- It was a typo: | ||
```js | ||
let newArtists = {}; | ||
for (let newArtist of action.payload) { | ||
newArtist[newArtist.id] = newArtist; | ||
} | ||
``` | ||
should be: | ||
```js | ||
let newArtists = {}; | ||
for (let newArtist of action.payload) { | ||
newArtists[newArtist.id] = newArtist; | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters