nolanlawson / pinafore

Alternative web client for Mastodon (UNMAINTAINED)
https://pinafore.social
GNU Affero General Public License v3.0
1.02k stars 172 forks source link

Reading direct messages fails if any of the convos returns a null last_status #2097

Closed amyspark closed 2 years ago

amyspark commented 2 years ago

Stacktrace:

cacheStatus (webpack://pinafore/src/routes/_database/timelines/cacheStatus.js#6)
insertTimelineStatuses (webpack://pinafore/src/routes/_database/timelines/insertion.js#76)
insertTimelineItems (webpack://pinafore/src/routes/_database/timelines/insertion.js#121)
get (webpack://pinafore/src/routes/_database/asyncDatabase.js#14)
S (webpack://pinafore/src/routes/_actions/timeline.js#21)
P (webpack://pinafore/src/routes/_actions/timeline.js#141)
L (webpack://pinafore/src/routes/_actions/timeline.js#190)
e (webpack://pinafore/src/routes/_actions/timeline.js#212)
$e (webpack://pinafore/src/routes/_components/timeline/Timeline.html#58)
Pe (https://pinafore.social/client/2026.d0da21e2fe3cb6dad23e.2026.js#1)
ee (webpack://pinafore/node_modules/svelte/shared.js#1056)
W (webpack://pinafore/node_modules/svelte/shared.js#972)
K (webpack://pinafore/node_modules/svelte/shared.js#1013)
a (webpack://pinafore/src/routes/_components/timeline/LazyTimeline.html#27)
l (https://pinafore.social/client/181.df6e8de6b0c6da93fea2.181.js#1)
ee (webpack://pinafore/node_modules/svelte/shared.js#1056)
W (webpack://pinafore/node_modules/svelte/shared.js#972)
A (https://pinafore.social/client/179.793efe1c246c905de9d9.main.js#2)
oe (webpack://pinafore/__sapper__/client.js#585)
ie (webpack://pinafore/__sapper__/client.js#547)
ie (webpack://pinafore/__sapper__/client.js#536)
me (webpack://pinafore/__sapper__/client.js#800)
me (webpack://pinafore/__sapper__/client.js#794)
<anónima> (webpack://pinafore/src/client.js#13)
<anónima> (webpack://pinafore/src/client.js#11)
<anónima> (https://pinafore.social/client/179.793efe1c246c905de9d9.main.js#2)
<anónima> (https://pinafore.social/client/179.793efe1c246c905de9d9.main.js#2)

The convo object that causes the error looks like this:

{
    "11": {
        "id": "87195",
        "unread": false,
        "accounts": [
            {
                                <PII stripped out...>
        ],
        "last_status": null
    }
}
nolanlawson commented 2 years ago

Interesting, I do see that last_status is supposed to be optional: https://docs.joinmastodon.org/entities/conversation/#optional-attributes

But I wonder: what does it mean for it to be optional? How can someone send you a direct message with no content in it?

Does Mastodon send the null last_status, or is this some other platorm like Pleroma or Misskey?

amyspark commented 2 years ago

@nolanlawson Mastodon 3.4.4. Perhaps the convo must've been a single message, but it's been deleted?

nolanlawson commented 2 years ago

Ahhh, ok. Why would Mastodon send a notification about it, then? This is very odd.

Also, IIUC, this doesn't actually cause the app to crash or anything, right? From reading the code, it looks like this should just be an error in the console with no other effect.

nolanlawson commented 2 years ago

Ah no wait, I see, this does cause a runtime error in the DMs view.

amyspark commented 2 years ago

@nolanlawson correct, it renders the DM view impossible to use. (FWIW, Mastodon frontend just ignores such a convo.)