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

Corrupt MBS-12714 relationship crashes the script #727

Closed
bricas opened this issue Nov 18, 2022 · 5 comments
Closed

Corrupt MBS-12714 relationship crashes the script #727

bricas opened this issue Nov 18, 2022 · 5 comments

Comments

@bricas
Copy link
Contributor

bricas commented Nov 18, 2022

image

helpers.js:88 Uncaught TypeError: Cannot read properties of undefined (reading 'id')
    at addRemoveEntities (userscript.html?name=mb.%2520COLLECTION%2520HIGHLIGHTER.user.js&id=a1e54da5-ed30-4a76-8ad1-68352dd29083:680:29)
    at browseTrack (userscript.html?name=mb.%2520COLLECTION%2520HIGHLIGHTER.user.js&id=a1e54da5-ed30-4a76-8ad1-68352dd29083:622:6)
    at browseReleases (userscript.html?name=mb.%2520COLLECTION%2520HIGHLIGHTER.user.js&id=a1e54da5-ed30-4a76-8ad1-68352dd29083:601:34)
    at XMLHttpRequest.<anonymous> (userscript.html?name=mb.%2520COLLECTION%2520HIGHLIGHTER.user.js&id=a1e54da5-ed30-4a76-8ad1-68352dd29083:514:4)
    at XMLHttpRequest.r (helpers.js:71:23)
@jesus2099
Copy link
Owner

jesus2099 commented Nov 18, 2022

Hi @bricas, thanks for the report.
First time I see things like userscript.html?name=….
What browser and userscript engine (Violentmonkey, Tampermonkey, Grease monkey) are you using?


Ok, reproduced on Android 9 Kiwi Browser on your collection:

Uncaught TypeError: Cannot read properties of undefined (reading 'id')
    at addRemoveEntities (mb. COLLECTION HIGHL…HTER.user.js:680:29)
    at browseTrack (mb. COLLECTION HIGHLIGHTER.user.js:622:6)
    at browseReleases (mb. COLLECTION HIGHL…HTER.user.js:601:34)
    at XMLHttpRequest.<anonymous> (mb. COLLECTION HIGHLIGHTER.user.js:514:4)
    at XMLHttpRequest.r (helpers.js:71:23)

It does not crash with my collection, so it should not be a too difficult bug fix.

It seems to be due to a work, or recording, or release, or release group.

@bricas
Copy link
Contributor Author

bricas commented Nov 18, 2022

Browser: Google Chrome 105.0.5195.125 (Official Build) (64-bit)
Engine: Tampermonkey 4.18.0

@jesus2099
Copy link
Owner

jesus2099 commented Nov 18, 2022

This recording, has an undefined linked work, according to the script:

{
	"id": "c244209d-b988-4c17-8a46-253f3b5e699b",
	"relations": [
		{
			"attribute-ids": {},
			"type": "performance",
			"recording": {
				"length": 271533,
				"disambiguation": "demo",
				"id": "9c1b5769-4464-4e59-b0f1-4ed8d5d0343d",
				"title": "If You Want",
				"video": false,
				"artist-credit": [
					{
						"name": "Martin L. Gore",
						"joinphrase": "",
						"artist": {
							"type": null,
							"disambiguation": "",
							"name": "Martin L. Gore",
							"id": "e08ac443-f1d2-4666-abd1-fa5859592981",
							"type-id": null,
							"sort-name": "Gore, Martin L."
						}
					}
				]
			},
			"target-credit": "",
			"attributes": [],
			"ended": false,
			"begin": null,
			"direction": "backward",
			"end": null,
			"source-credit": "",
			"attribute-values": {},
			"type-id": "a3005666-a872-32c3-ad06-98af558e99b0",
			"target-type": "recording"
		},
		{
			"target-credit": "",
			"recording": {
				"disambiguation": "",
				"length": 343000,
				"id": "3f52307a-696a-4172-9b69-241878018f1f",
				"title": "Some Great Reward (A Dark trance)",
				"video": false,
				"artist-credit": [
					{
						"artist": {
							"name": "Depeche Mode",
							"type": null,
							"disambiguation": "",
							"id": "8538e728-ca0b-4321-b7e5-cff6565dd4c0",
							"type-id": null,
							"sort-name": "Depeche Mode"
						},
						"joinphrase": "",
						"name": "Depeche Mode"
					}
				]
			},
			"attribute-ids": {},
			"type": "samples material",
			"type-id": "9efd9ce9-e702-448b-8e76-641515e8fe62",
			"source-credit": "",
			"attribute-values": {},
			"target-type": "recording",
			"attributes": [],
			"ended": false,
			"begin": null,
			"end": null,
			"direction": "backward"
		},
		{
			"work": {
				"type-id": "f061270a-2fd6-32f1-a641-f0f8676d14e6",
				"id": "341a9038-5cf8-3ca6-9702-e3ae82e0cf9e",
				"languages": [
					"eng"
				],
				"iswcs": [
					"T-011.237.340-6"
				],
				"attributes": [],
				"type": "Song",
				"disambiguation": "",
				"title": "If You Want",
				"language": "eng"
			},
			"attribute-ids": {},
			"type": "performance",
			"target-credit": "",
			"begin": null,
			"attributes": [],
			"ended": false,
			"end": null,
			"direction": "forward",
			"type-id": "a3005666-a872-32c3-ad06-98af558e99b0",
			"source-credit": "",
			"attribute-values": {},
			"target-type": "work"
		}
	],
	"video": false,
	"first-release-date": "1984-09-24",
	"length": 280866,
	"disambiguation": "",
	"title": "If You Want",
	"artist-credit": [
		{
			"artist": {
				"type-id": "e431f5f6-b5d2-343d-8b36-72607fffb74b",
				"sort-name": "Depeche Mode",
				"name": "Depeche Mode",
				"type": "Group",
				"disambiguation": "",
				"id": "8538e728-ca0b-4321-b7e5-cff6565dd4c0"
			},
			"joinphrase": "",
			"name": "Depeche Mode"
		}
	]
}

Oh I see a performance of… recording! Instead of the usual work.
I didn't know this kind of relationships recording performance of recording.

@bricas
Copy link
Contributor Author

bricas commented Nov 18, 2022

Something strange going on there, no? If you edit that recording, it looks like a duplicate relation to the work is there.

https://musicbrainz.org/recording/9c1b5769-4464-4e59-b0f1-4ed8d5d0343d/edit

@jesus2099
Copy link
Owner

I reported the strange MBS-12714 bug and wrote a work-around.

@jesus2099 jesus2099 changed the title mb_COLLECTION-HIGHLIGHTER hangs loading my collection Corrupt MBS-12714 relationship crashes the script Nov 18, 2022
jesus2099 added a commit that referenced this issue Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants