Skip to content

Add slowdown to reduce ajax rate…#135

Open
Sophist-UK wants to merge 4 commits intoFrug:masterfrom
Sophist-UK:add_slowdown_when_not_sending
Open

Add slowdown to reduce ajax rate…#135
Sophist-UK wants to merge 4 commits intoFrug:masterfrom
Sophist-UK:add_slowdown_when_not_sending

Conversation

@Sophist-UK
Copy link
Contributor

... if user is not actively typing messages. So e.g. normal ajax rate is every 2s, but if user has not sent anything for say 60 seconds, then the ajax rate slows to e.g. every 10s until they send something again. This will assist with scalability by reducing the number of ajax calls being made.

Also:

  1. Add debugging setting / console.log messages / alerts.
  2. Correct the retry timeout calculation which looked incorrect.
  3. Add a status blinking icon to the logs screen
  4. Add classes on the #content div so you can distinguish between chat and log views in custom css.
  5. Using 4., avoid need to show log settings by setting chatbox right margin on logs.

@Frug
Copy link
Owner

Frug commented Jan 27, 2014

The slowdown will need to be an option because I know some users keep chat open for long periods and just read, but don't want a 10s wait between updates. I'd get complaints from my users. In a busy room it would result in lumping messages together a lot (while in an idle room it would certainly save bandwidth for all).

I plan to introduce real user statuses soon (v0.9.1?). Specifically this was for an afk status, but an automatic status of idle would also work for this. Rather than gradually slow, I would have users hit idle after x seconds and then slow their updater. That way they know their status has been slowed.

I need to review the retry timer calc. You may be right, I made that ages ago as a patch to force an update after many users reported needing to send a message to wake chat up after it randomly fell asleep on connection problems.

Since I'm now using the testing branch, I will merge this into master because why not.

If you could though, keep the pull requests to individual items so I don't have to toss your request if I have a problem with one of them ;)

@Sophist-UK
Copy link
Contributor Author

The time since last message before slowdown and the rate after slowdown are both new options set in config,js.

@Frug
Copy link
Owner

Frug commented Jan 27, 2014

Oh I see. Sorry. I'll add it now and later have it flag them as idle.

@ajquick
Copy link

ajquick commented Jan 1, 2019

Maybe it would be good to slow the chat down if it isn't in focus?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants