ThePandemoniumInstitute / botc-release

The Official Blood on the Clocktower App
https://botc.app
35 stars 2 forks source link

[BUG] Disconnect when uploading large script #265

Closed Totox00 closed 3 weeks ago

Totox00 commented 3 weeks ago

Description

I tried to upload a large script file (13.8 MB). It resulted in no errors being shown, instead I was disconnected and after about a second it reverted to the previously loaded script.

Steps to reproduce

Upload the attached script arkham-mayhem.official.json (might require custom images to be shown, I suspect the issue is caused by the large data URIs)

Browser

Chrome

Operating System

Linux

Date and Time

November 2nd, 21:00 UTC

Game Session

viddie

Relevant console log output

No response

bra1n commented 3 weeks ago

Hey there, this is not a bug, but a safety precaution for when your app client is sending too much data. I've looked at the JSON you provided and it seems like all the icons are inlined into Base64 encoded data URIs, which essentially means that all script icons would be stored together with the JSON on the database. Our database is not built for storing images, so you will have to host your icons somewhere externally. That said, I will add a file size restriction check to the UI with the next update, so that you get a meaningful error message, rather than being disconnected in the future.