Chatroom Data Limit

[Posts in the debugging category need to have the following pieces of information included in order to help other teachers or our moderator team best help you. Feel free to delete everything in brackets before posting your request for debugging help.]

Link to project

The code is written to act as a chatroom, made just for funzies. But when a third user enters, the data limit is hit and the whole thing crashes. I get a crash report

"
WARNING: Line: 81: Data access rate limit exceeded; Please wait 10 seconds before retrying. The app is reading/writing data too many times per second. If you were trying to write data, it wasn’t written.
WARNING: Line: 55: Data access rate limit exceeded; Please wait 10 seconds before retrying. The app is reading/writing data too many times per second. If you were trying to write data, it wasn’t written.
WARNING: Line: 81: Data access rate limit exceeded; Please wait 10 seconds before retrying. The app is reading/writing data too many times per second. If you were trying to write data, it wasn’t written.
"

I’ve tried to change the for loops to use timedLoop(), setInterval(), and removing entirely. The only thing that half worked was removing them, but then nothing was sending and data wasn’t kept in line within the record tables. I’m wondering what I can do to either scale the loading speed to account for the user count, or what I can put in place of these for loops to make it not crash at 3 people.

important note

I cannot use really any other coding platform with Data records. Scratch is blocked on the IP and hardware, and all other IDEs that I know of do not work, thus code.org being my only (known) option for such a project. This is entirely for fun and is not meant to bend rules or cause turmoil.

I am not a code.org employee… just a forum moderator, however, my guess would be that the engineers have possibly added this limit on purpose.

The code.org platform is designed mostly to further the mission of code.org and help middle and high school students learn how to code. It wasn’t intended for data intensive projects that aren’t related to the code.org curriculum. In addition, chat apps could be used with inappropriate content, so that could also play into it as most schools depend on the environment being clean and appropriate for students.

So, although this isn’t an official code.org response, that would be my best guess. You could reach out to support@code.org, but it’s not likely a bug they would prioritize fixing as it doesn’t relate directly to the curriculum or mission of code.org

For chat apps and other similar projects, you may end up having to find a paid service.

Mike

1 Like

Thank you for your reply! I can understand why they’ve implemented this, and it’s honestly a very good observation I did not notice. Thank you for pointing this out to me!

You need to update your rate limit each project has a collective rate limit rather than a user rate limit for writing and appending to the db, also having all clients check for older messages is a bad idea as it uses up a read or write count. the CDO github i believe went over this somewhere in their discussions tab at somepoint when they had migrated their db

for instance if a new user is to join load all previous messages once, then maybe up your delay by like 5 to 10 seconds in the interval i have had no writting conflicts with three people or instances of the project running this way

I will try this, Thank you!