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

Mastify crashes when a status ID falls outside of long #106

Open
blueset opened this issue Apr 7, 2024 · 3 comments
Open

Mastify crashes when a status ID falls outside of long #106

blueset opened this issue Apr 7, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@blueset
Copy link

blueset commented Apr 7, 2024

Mastify crashes when the ID of a status in the timeline is too large or not strictly numerical.
The crash happens on this line when trying to convert the ID to a long integer.

val contentId by lazy { content.id.toLong() }

@whitescent
Copy link
Owner

whitescent commented Apr 7, 2024

Hi, I've seen this issue on Firebase before, the reason for this crash is that the backend API of some instances is not returning a pure number.

Traditional Mastodon's status id returned:

{
 "status id" = "111100",
 "status id" = "100000"
}

but some instances returned:

{
 "status id" = "01HR87K6TSASFAS0MECESFAWEA",
 "status id" = "01HR34K6TR1XBC0MECER0R4ARD"
}

I'll probably fix this issue in the future when I do other instance compatibility

@whitescent
Copy link
Owner

whitescent commented Apr 7, 2024

Hi @blueset , if its possible, could you capture the package using tools like postman to capture the json that returned from the those mastodon instance which not returned pure number? just need include status_id

image

btw, the timeline api is : https://your instance url/api/v1/timelines/home

I'll write a new set of unit tests to fix this

@blueset
Copy link
Author

blueset commented Apr 7, 2024

Reference implementation 1: (Iceshrimp / Sharkey)

[
  {
    "id": "9rtd7vwwaml2ge0f",
    "reblog": null,
    "quote": null
  },
  {
    "id": "9rtd4foozyzfc4wu",
    "reblog": null,
    "quote": null
  },
  {
    "id": "9rtd44vsbczhe4ha",
    "reblog": {
      "id": "9riu90e8eqzcs4qr"
    },
    "quote": null
  },
  {
    "id": "9rtd3ypkycb5fl9v",
    "reblog": null,
    "quote": null
  },
  {
    "id": "9rtd1434p3j77k0m",
    "reblog": null,
    "quote": null
  },
  {
    "id": "9rtcymkwk72rwrg3",
    "reblog": null,
    "quote": null
  },
  {
    "id": "9rtcv0y8r37gxtx2",
    "reblog": null,
    "quote": null
  },
  {
    "id": "9rtcqglkj1ge1ay5",
    "reblog": null,
    "quote": null
  },
  {
    "id": "9rtcoao0rt39noyh",
    "reblog": null,
    "quote": null
  },
  {
    "id": "9rtcmcg8pq2k8zvk",
    "reblog": null,
    "quote": null
  },
  {
    "id": "9rtcjfighh6lvzq0",
    "reblog": null,
    "quote": null
  },
  {
    "id": "9rtcgk48qu6xrb00",
    "reblog": null,
    "quote": null
  },
  {
    "id": "9rtcdhs0s95ogbwt",
    "reblog": null,
    "quote": null
  },
  {
    "id": "9rtcc22wpoxpkq6e",
    "reblog": null,
    "quote": null
  },
  {
    "id": "9rtc9sagr6ay964t",
    "reblog": null,
    "quote": null
  },
  {
    "id": "9rtc99ppwk5mc8hs",
    "reblog": null,
    "quote": null
  },
  {
    "id": "9rtc8yywt85bulbm",
    "reblog": null,
    "quote": null
  },
  {
    "id": "9rtc8aa0rny91p28",
    "reblog": null,
    "quote": null
  },
  {
    "id": "9rtc7gygr139fuss",
    "reblog": null,
    "quote": null
  },
  {
    "id": "9rtc6fx4grc9vkxc",
    "reblog": null,
    "quote": null
  },
  {
    "id": "9rtc5srstwf9zyy2",
    "reblog": null,
    "quote": null
  },
  {
    "id": "9rtc5bsos5emru4f",
    "reblog": null,
    "quote": null
  },
  {
    "id": "9rtc3wvca5lepfcj",
    "reblog": null,
    "quote": null
  },
  {
    "id": "9rtc3ahsji1nzd12",
    "reblog": null,
    "quote": null
  },
  {
    "id": "9rtc03iwq3yt76ci",
    "reblog": null,
    "quote": null
  },
  {
    "id": "9rtbx3i0gdjwx9hs",
    "reblog": null,
    "quote": null
  },
  {
    "id": "9rtbwfkwwqz5xeqx",
    "reblog": null,
    "quote": null
  },
  {
    "id": "9rtbu48wzo2mrcfh",
    "reblog": null,
    "quote": null
  },
  {
    "id": "9rtbq36oet4lw4wp",
    "reblog": {
      "id": "9rtblxhso4iwwxad"
    },
    "quote": null
  },
  {
    "id": "9rtblxhso4iwwxad",
    "reblog": null,
    "quote": null
  },
  {
    "id": "9rtbk34wjxvusk9f",
    "reblog": {
      "id": "9rtbjmxkkv4jedre"
    },
    "quote": null
  },
  {
    "id": "9rtbjp8wsnz37b14",
    "reblog": null,
    "quote": null
  },
  {
    "id": "9rtbh4nkqve22bxv",
    "reblog": {
      "id": "9rtb55bsoyx1bffx"
    },
    "quote": null
  },
  {
    "id": "9rtbg7h4d108a1ln",
    "reblog": null,
    "quote": null
  },
  {
    "id": "9rtbf2kwtvnc69d8",
    "reblog": null,
    "quote": null
  },
  {
    "id": "9rtbadlkxyiegppc",
    "reblog": null,
    "quote": null
  },
  {
    "id": "9rtb8nvcgdl8phko",
    "reblog": {
      "id": "9rta1jegmngpvoyp"
    },
    "quote": null
  },
  {
    "id": "9rtb7m28n9xhd5fq",
    "reblog": null,
    "quote": null
  },
  {
    "id": "9rtb6vtsp1k8kobp",
    "reblog": null,
    "quote": null
  },
  {
    "id": "9rtb43iod12i3mug",
    "reblog": null,
    "quote": null
  }
]

Reference implementation 2: (Firefish)

[
  {
    "id": "2160331621499898780280764",
    "reblog": {
      "id": "2160290606305117182038885"
    },
    "quote": {
      "id": "2160290606305117182038885"
    }
  },
  {
    "id": "2160322480738744663681058",
    "reblog": null,
    "quote": null
  },
  {
    "id": "2160312274739225267921724",
    "reblog": {
      "id": "2160188315680393176923619"
    },
    "quote": null
  },
  {
    "id": "2160309940420082556411216",
    "reblog": {
      "id": "2160142314662922900731552"
    },
    "quote": null
  },
  {
    "id": "2160308857747229519296724",
    "reblog": {
      "id": "2160176120022358522706534"
    },
    "quote": null
  },
  {
    "id": "2160307718500637746520196",
    "reblog": {
      "id": "2160274037927581460035247"
    },
    "quote": null
  },
  {
    "id": "2160255018915046588584470",
    "reblog": {
      "id": "2160252471760687348562907"
    },
    "quote": null
  },
  {
    "id": "2160051325871581060311373",
    "reblog": null,
    "quote": null
  },
  {
    "id": "2159863767754561060421689",
    "reblog": null,
    "quote": null
  },
  {
    "id": "2159858528183704423147018",
    "reblog": {
      "id": "2159857458732571194899690"
    },
    "quote": null
  },
  {
    "id": "2159853613187919955487283",
    "reblog": null,
    "quote": null
  },
  {
    "id": "2159622559919194759352536",
    "reblog": null,
    "quote": null
  },
  {
    "id": "2159610227927947564051731",
    "reblog": {
      "id": "2159396195978883485076095"
    },
    "quote": null
  },
  {
    "id": "2159555686290378273347694",
    "reblog": {
      "id": "2159525859830805947741680"
    },
    "quote": null
  },
  {
    "id": "2159488638938851707854819",
    "reblog": {
      "id": "2159485376904153431341093"
    },
    "quote": null
  },
  {
    "id": "2159484899602618766902633",
    "reblog": null,
    "quote": null
  },
  {
    "id": "2159377127474501651426693",
    "reblog": null,
    "quote": null
  },
  {
    "id": "2159357278973088479209846",
    "reblog": {
      "id": "2159290799310911334910320"
    },
    "quote": null
  },
  {
    "id": "2159299821218225522623076",
    "reblog": {
      "id": "2159296983185593818631001"
    },
    "quote": null
  },
  {
    "id": "2159299465118711848369786",
    "reblog": {
      "id": "2159296424604389263347253"
    },
    "quote": null
  },
  {
    "id": "2159299280710982989303058",
    "reblog": {
      "id": "2159296726463158217969477"
    },
    "quote": null
  },
  {
    "id": "2159296372691891596718296",
    "reblog": null,
    "quote": null
  },
  {
    "id": "2159026701209374695555539",
    "reblog": null,
    "quote": null
  },
  {
    "id": "2159006948503056870506980",
    "reblog": {
      "id": "2158920506066617479453185"
    },
    "quote": null
  },
  {
    "id": "2158890671408603148502430",
    "reblog": {
      "id": "2158888726263537726802667"
    },
    "quote": null
  },
  {
    "id": "2158839706836261585984749",
    "reblog": null,
    "quote": null
  },
  {
    "id": "2158792286931722438792590",
    "reblog": {
      "id": "2158779583165189809980902"
    },
    "quote": null
  },
  {
    "id": "2158791602536254205594035",
    "reblog": null,
    "quote": null
  },
  {
    "id": "2158774273046292496108489",
    "reblog": null,
    "quote": null
  },
  {
    "id": "2158761942697286974571423",
    "reblog": {
      "id": "2158230327170593001170903"
    },
    "quote": null
  },
  {
    "id": "2158761311380798751361282",
    "reblog": {
      "id": "2158756613688442354990642"
    },
    "quote": null
  },
  {
    "id": "2158617118632634479384906",
    "reblog": null,
    "quote": null
  },
  {
    "id": "2158603906124810243551285",
    "reblog": {
      "id": "2158582418613517603338855"
    },
    "quote": {
      "id": "2158582418613517603338855"
    }
  },
  {
    "id": "2158585177743990475557178",
    "reblog": {
      "id": "2158582418613517603338855"
    },
    "quote": null
  },
  {
    "id": "2158584416918439554940290",
    "reblog": {
      "id": "2158582692262130426316003"
    },
    "quote": null
  },
  {
    "id": "2158498728393830947746690",
    "reblog": null,
    "quote": null
  },
  {
    "id": "2157840571018368089846325",
    "reblog": null,
    "quote": null
  },
  {
    "id": "2157402824583181729522053",
    "reblog": null,
    "quote": null
  },
  {
    "id": "2156202448963297007110621",
    "reblog": null,
    "quote": null
  },
  {
    "id": "2154439952599589168169245",
    "reblog": null,
    "quote": null
  }
]

@whitescent whitescent added the bug Something isn't working label Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants