Chatterino2: Crash on startup

Created on 16 Nov 2020  路  12Comments  路  Source: Chatterino/chatterino2

Describe the bug
Chatterino crashes on startup

[FFZEmotes] Reload FFZ Channel Emotes for channel "148973258"
chatterino: ../src/providers/ffz/FfzEmotes.cpp:22: chatterino::Url chatterino::{anonymous}::getEmoteLink(const QJsonObject&, const QString&): Assertion `emote.isString()' failed.
[1]    42191 abort (core dumped)  chatterino

After removing that channel, next channel crashes

[FFZEmotes] Reload FFZ Channel Emotes for channel "22484632"
chatterino: ../src/providers/ffz/FfzEmotes.cpp:22: chatterino::Url chatterino::{anonymous}::getEmoteLink(const QJsonObject&, const QString&): Assertion `emote.isString()' failed.
[1]    42618 abort (core dumped)  chatterino

To reproduce
Unsure. Something related to FFZ Emotes.

Screenshots

Chatterino version
7d2b640874d1975492bb6c814acd2bba944e72be

Operating system
Manjaro

Aditional Information
Maybe related to FFZ doing maintenance today?

bug

Most helpful comment

Just wanted to chime in and say sorry for the trouble. I 100% did not expect anyone to have any issues since the fields are null, but here we are.

(This happened because I've started serving the v1 API from a newer codebase that does output sanitization based off a schema, and it will insert null values where data is missing. Plus side, the new API is considerably faster and has a new caching scheme that means emotes update pretty much instantly. We also have new generated docs at https://api.frankerfacez.com/docs/)

All 12 comments

My chatterino is crashing instantly the moment I try to open it. I reinstalled multiple times - then finally i am able to open it but the moment I type a channel name and press enter it crashes again.

"Application Specific Information:
Assertion failed: (emote.isString()), function getEmoteLink, file ../src/providers/ffz/FfzEmotes.cpp, line 22."
is part of the report, not sure how to fix.

You can fix it temporarily by commenting out the Assert in FfzEmotes.cpp line 22 and recompiling

After doing some investigating, the FFZ API is returning nulls in their emote URL responses.

GET https://api.frankerfacez.com/v1/emote/381434

{
    "emote": {
        "id": 381434,
        "name": "4House",
        "height": 32,
        "width": 32,
        "public": true,
        "hidden": false,
        "modifier": false,
        "offset": null,
        "margins": null,
        "css": null,
        "owner": {
            "_id": 512619,
            "name": "auqra",
            "display_name": "auqra"
        },
        "urls": {
            "1": "//cdn.frankerfacez.com/emoticon/381434/1",
            "2": null,
            "4": null
        },
        "status": 1,
        "usage_count": 13,
        "created_at": "2019-08-19T18:41:46.408Z",
        "last_updated": "2019-08-22T09:20:09.237Z"
    }
}

However, Chatterino only checks for undefined values, not null values:
https://github.com/Chatterino/chatterino2/blob/7d2b640874d1975492bb6c814acd2bba944e72be/src/providers/ffz/FfzEmotes.cpp#L16-L20

So what's the solution?

@thelobbylegend see #2192

@swills I see it but what am I supposed to do lol. I see a bunch of words.

https://github.com/Chatterino/chatterino2/pull/2192/checks?check_run_id=1408346531 - Download the correct build in artifiacts 3. It fixes the issue~
Screen Shot 2020-11-16 at 3 29 31 PM

@swills @jonnyboy123321 Ok, it worked. A message is prompted (see attached). I installed the update and chatterino would start crashing again. I uninstalled chatterino and downloaded from artifacts again without updating it and it works fine. I assume I just shouldn't install the update for chatterino?

Message: https://gyazo.com/4ea592ad6175f60e44ee0f1f45643982

The update are not meant for nightlies. Ignore them on such builds.

Ah got it. Thank you all.

Just wanted to chime in and say sorry for the trouble. I 100% did not expect anyone to have any issues since the fields are null, but here we are.

(This happened because I've started serving the v1 API from a newer codebase that does output sanitization based off a schema, and it will insert null values where data is missing. Plus side, the new API is considerably faster and has a new caching scheme that means emotes update pretty much instantly. We also have new generated docs at https://api.frankerfacez.com/docs/)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

LeaPhant picture LeaPhant  路  3Comments

SaDiablo picture SaDiablo  路  3Comments

Oscillate1 picture Oscillate1  路  3Comments

TETYYS picture TETYYS  路  3Comments

zamusek picture zamusek  路  3Comments