frozenpandaman / s3s

Successor to splatnet2statink. Takes battle data from the SplatNet 3 app and uploads it to stat.ink!
https://github.com/frozenpandaman/s3s/wiki
GNU General Public License v3.0
394 stars 72 forks source link

Splatnet bug? #189

Closed Mysterium-Mystery closed 6 days ago

Mysterium-Mystery commented 1 month ago

So, during the splatfest I started getting an error during the upload of one of the battles telling me to restart s3s. This did not solve the issue. I looked at the code and the issue is that this request returns Http code 500

result_post = requests.post(iksm.GRAPHQL_URL,
            data=utils.gen_graphql_body(utils.translate_rid[dict_key], dict_key2, hash),
            headers=headbutt(forcelang=lang),
            cookies=dict(_gtoken=GTOKEN))

So I looked at Splatnet (in the browser) and saved the part of the JSON corresponding to the problematic battle. Here it is:

{
                                    "id": "VnNIaXN0b3J5RGV0YWlsLXUtYWpvYnd1cW9rNGg3N25jdXZubW06UkVHVUxBUjoyMDI0MDcxM1QxOTA3MjZfNDFiODZlNGQtYzBmZC00NzAyLWE4MzEtNGFjYjgyNTJhMWU4",
                                    "vsMode": {
                                        "mode": "FEST",
                                        "id": "VnNNb2RlLTY="
                                    },
                                    "playedTime": "2024-07-13T19:07:26Z",
                                    "vsRule": {
                                        "name": "Turf War",
                                        "id": "VnNSdWxlLTA="
                                    },
                                    "vsStage": {
                                        "name": "Manta Maria",
                                        "id": "VnNTdGFnZS0xOA==",
                                        "image": {
                                            "url": "https://api.lp1.av5ja.srv.nintendo.net/resources/prod/v2/stage_img/banner/low_resolution/0b7fd997781e03eb9d5bf1875ed070f698afc654f4fe929452c65aa26c0a35fd_3.png?Expires=1736467200\u0026Signature=L7dcpZJEJao3KPkbAr0FyVuFlX2oV6n6RiZki3P3PBuKgQU6pindumD-LWHASAgmiqid4UpGLqPfb8NERZQR2wHGtJWUtNeMApZrZpRHz2RhRt0oaPoVFmDpRFt3x6aNvaiHP2d~VODJzmgmwR5arbE4QM9bxoTnYXq~j3ex72q4xqpevlgdTZiSoow06E3Sl9Ju26gAMOesxmUGeBduqH2au4doVgKdbLcAoreDjBXDY7FhSZIfc1w4wJDh9Pcep1p0qsB7KKv00touhD0~DBtrKZz4OPFyJA1nZeDZsl-AAH-xKvagJyAJPtdqCktkkjHJu2aTCCkw3aMgrsopsQ__\u0026Key-Pair-Id=KNBS2THMRC385"
                                        }
                                    },
                                    "judgement": "EXEMPTED_LOSE",
                                    "player": {
                                        "weapon": {
                                            "name": "Neo Sploosh-o-matic",
                                            "image": {
                                                "url": "https://api.lp1.av5ja.srv.nintendo.net/resources/prod/v2/weapon_illust/1e36641ce3d34e968bf643f99f133be19aa4de9801e0faf69599cf8dfabfa281_1.png?Expires=1736467200\u0026Signature=oKNZQggua3zQSxjbHj-xviD93Cga7hPSGq55f~YMrSnQ08PDzHOh6fPrfM7596AapDYcxNU8nMCAJmlEgBIAVC3ptKwGCn2iTI8ahWVbywgfy50-ge9-RQwo5S2toWIItQ3W9zRTyDs4i8aNTSPCZQQCC~x6uTTIwIAG5q47uwTGl9-1PGeohVcPQasMlrhM6rEOLSRBCrjzsnv60subJ4rq7mgnik3crxZJ39VRn9dZsSlwldAT~HikzTnQgB9frKODGh3Lhu2B1sxVL8xIdVfENRrWfY-jB9TzKY3knOaa9icDprLKHCM5OUm91OIIpeRShFQcQfknbayZlxakNg__\u0026Key-Pair-Id=KNBS2THMRC385"
                                            },
                                            "id": "V2VhcG9uLTE="
                                        },
                                        "id": "VnNQbGF5ZXItdS1ham9id3Vxb2s0aDc3bmN1dm5tbTpSRUdVTEFSOjIwMjQwNzEzVDE5MDcyNl80MWI4NmU0ZC1jMGZkLTQ3MDItYTgzMS00YWNiODI1MmExZTg6dS1ham9id3Vxb2s0aDc3bmN1dm5tbQ==",
                                        "festGrade": "Theme Park Defender"
                                    },
                                    "knockout": "NEITHER",
                                    "myTeam": {
                                        "result": {
                                            "paintPoint": 1239,
                                            "score": null
                                        }
                                    },
                                    "nextHistoryDetail": {
                                        "id": "VnNIaXN0b3J5RGV0YWlsLXUtYWpvYnd1cW9rNGg3N25jdXZubW06UkVHVUxBUjoyMDI0MDcxM1QxOTEyMDhfZmQzOTU0ZTQtNDM0ZC00YTg5LTgyNzQtYWRlZTIyMDdkMzcz"
                                    },
                                    "previousHistoryDetail": {
                                        "id": "VnNIaXN0b3J5RGV0YWlsLXUtYWpvYnd1cW9rNGg3N25jdXZubW06UkVHVUxBUjoyMDI0MDcxM1QxOTAyNTJfNjlkYjBkOWQtNDczZC00NTcxLWI2NTQtZjgzNDQzYWQ2NTVh"
                                    }
                                }

Later I noticed that this is not the complete JSON for the battle and that I had to click on it to get the full battle info. Clicking on it in Splatnet results in an error and the exact same Http error 500 Bild_2024-07-15_222452515

Ingame the battle can actually be viewed without any issue Bild_2024-07-15_222709329

As you can see there was a DC but it must have occured after the battle ended because all players remained in the battle until the end. I wonder if this somehow caused this issue. Either way, this seems to be a bug in Splatnet then, I guess? I'm just wondering if anyone ever heard of anything like this occuring and what I should do about this? Should I report the bug to Nintendo?

frozenpandaman commented 1 month ago

How bizarre... just to confirm, clicking to view the battle details in the NSO app on your phone results in an error?

If so, that's definitely something on Nintendo's end, yeah. You could indeed report it to them. I can put a try/catch around that part of the code in s3s so it won't error out, though, even if this is (apparently) a very, very rare occurrence...!

EDIT: Just realized this is already done (which OP mentioned): https://github.com/frozenpandaman/s3s/blob/8ce795d4bdb5a5182ada8984a5c115fb26e378ec/s3s.py#L1404-L1410

Powerikuun commented 1 month ago

I believe this is a bug on the game's end, not the application.

I've been having this same issue but now that I think about it, there was this weird bug that happened to the one match that had bugged.

At the end of the match, everything played out like normal, but then suddenly the music cut out and the winning music repeated again, and then it booted us with a "A communication error has occurred", before booting me and my friends back to the lobby.

In my personal opinion, I would say to have s3s skip any matches that can't be open with a prompt that says "Unable to read match. Skipping..." or something along those lines.

Mysterium-Mystery commented 1 month ago

I originally tested it on the browser version but I just tried it on the app and the result is exactly the same. It really is extremely weird and I do wonder if I'm maybe even the first to encounter this bug. I guess I'll report it to Nintendo then

You did actually already put this in a try bracket but after an error it simply tries the request again and gives up after that. There even is a built in way to just skip battles in case of an error (which I also used) by adding "errors_pass_silently": "true" to the config file but that option is very hidden from the user since it's never mentioned and the only way to find out about it is to look at the code.

So yeah, it'd probably be good to either catch the Http 500 error explicitly or tell the user about the error_pass_silently option or something along those lines ^^

Mysterium-Mystery commented 1 month ago

I believe this is a bug on the game's end, not the application.

I've been having this same issue but now that I think about it, there was this weird bug that happened to the one match that had bugged.

At the end of the match, everything played out like normal, but then suddenly the music cut out and the winning music repeated again, and then it booted us with a "A communication error has occurred", before booting me and my friends back to the lobby.

In my personal opinion, I would say to have s3s skip any matches that can't be open with a prompt that says "Unable to read match. Skipping..." or something along those lines.

Oh and I actually don't think it's the games fault. I know what you're talking about and I had this happen multiple times already but in this case I never got a communication error. I didn't even notice that there were any DCs at that point.

strohitv commented 1 month ago

I don't think I can help much but I wanna point out it's odd that even in the screenshot you posted of the game, the dc is on the top most spot.

As far as I know, dcs are always at the bottom (since their paint gets set to 0). So while you can see the result in game, this still seems fishy to me.

Can you watch the game replay? What happens when you create a replay code and let a friend download it? Can the friend watch it and how does the result screen look like for them?

Mysterium-Mystery commented 1 month ago

I didn't even notice that :o But now that you point it out, their paint score does display for some reason although it normally doesn't. That's really weird

The replay idea is really interesting but sadly I can't watch it since all battles from before the update aren't compatible with the newest version

Lastorder-DC commented 1 month ago

Add "errors_pass_silently": "true" to config.txt to bypass error and continue uploading battlelog.

Like below

{
    "api_key": "<REMOVED>",
    "acc_loc": "<REMOVED>",
    "gtoken": "<REMOVED>",
    "bullettoken": "<REMOVED>",
    "session_token": "<REMOVED>",
    "f_gen": "https://api.imink.app/f",
    "errors_pass_silently": "true"
}
Mysterium-Mystery commented 1 month ago

I actually already mentioned that

There even is a built in way to just skip battles in case of an error (which I also used) by adding "errors_pass_silently": "true" to the config file but that option is very hidden from the user since it's never mentioned and the only way to find out about it is to look at the code.

frozenpandaman commented 1 month ago

by adding "errors_pass_silently": "true" to the config file but that option is very hidden from the user since it's never mentioned and the only way to find out about it is to look at the code

Haven't had time to go through the recent comments on this thread yet, but just want to point out that it is indeed listed on the wiki page for all the different config keys, which is linked & mentioned in the README :)

https://github.com/frozenpandaman/s3s/wiki/config-keys

Mysterium-Mystery commented 1 month ago

Ah, didn't know that ^^' Last time I checked the wiki was ages ago xD I still think it'd probably be better to explicitly catch this error or tell the user about the setting in the error message but at least there is a way to find out about this as a normal user

haykam821 commented 1 month ago

I had a similar issue with one of my battles during the recent Splatfest. I disconnected mid-match a few seconds after my teammate disconnected. Unfortunately, the battle is not in my past 50 battles anymore, and I didn't record any of its raw data past its ID.

frozenpandaman commented 6 days ago

Improved what gets displayed to the user. Hopefully this is good enough? I think it's all we can do.