Commit graph

48 commits

Author SHA1 Message Date
deerfarce 6f8bde91e1 adjust sendUserMeta rank comparison
includes users with the same rank as the minimum rank for the action when sending the meta frame
2020-09-22 20:12:09 -07:00
Calvin Montgomery 9e5fcf4904 Fix #866 2020-05-17 10:42:21 -07:00
Calvin Montgomery 106065184f Remove old flatfile chandump storage 2020-02-15 16:17:49 -08:00
Calvin Montgomery 1923af16a9 Fix a few minor error conditions 2018-09-30 21:22:20 -07:00
Calvin Montgomery c7fcd11e53 Fix channel save error introduced by removing async-to-generator 2018-08-29 20:59:07 -07:00
Calvin Montgomery bfe0d75278 Add check for error condition exposed by misbehaving bot 2018-04-08 19:19:22 -07:00
Calvin Montgomery 976b0a2168 Fix error introduced by lint changes 2018-04-08 19:17:03 -07:00
Calvin Montgomery 62417f7fb8
Add eslint (#741) 2018-04-07 15:30:30 -07:00
Adam davis 953428cad5 Add Admin Setting - Block anonymous connections (#740) 2018-04-07 11:24:52 -07:00
Calvin Montgomery 726a5bf7c4 Minor tweaks to specific error conditions 2018-02-24 19:51:28 -08:00
Calvin Montgomery aeab31825e Fix a raw file error caused by facebook CDN violating RFC 2616 2018-01-21 18:53:16 -08:00
Calvin Montgomery 6d0498987a Add sanity check for one instance of error unload
Unfortunately I think this is just one of a whole class of race
conditions caused by errored channels being unloaded immediately without
waiting for the refcounter to reach 0.

However, this one is the only one that appears commonly in the logs so
adding this check should buy time to rethink the overall problem.
2018-01-06 10:09:22 -08:00
Calvin Montgomery 0c330a82ce Add dirty check to playlist for efficiency of channel saving 2017-12-16 10:34:04 -08:00
Calvin Montgomery fbee6d2ab7 Fix a few common causes of error logs (incl. better ffprobe error messages) 2017-12-10 16:39:06 -08:00
Calvin Montgomery c4cc22dd05 Add experimental feature to reduce database writes for channel data 2017-12-10 10:36:28 -08:00
Calvin Montgomery a90d88ad65 Fix race condition that might be causing errors 2017-08-12 13:30:24 -07:00
Calvin Montgomery 0118a6fb15 Refactor socket.io controller 2017-08-01 19:29:11 -07:00
Calvin Montgomery 07179d6c83 Upgrade to jsli 2.0 2017-07-08 20:11:54 -07:00
Xaekai 18bf1b946b Minor fixes to afk stuff. 2017-06-29 19:04:49 -07:00
Calvin Montgomery 53cee986c6 Resend userlist if rank changes meta visibility
Fixes #681.  Technically, resending the entire userlist is not
necessary; it would be sufficient to resent setUserMeta, but there's not
currently a bulk frame for that so sending the userlist is probably more
efficient.
2017-06-17 09:47:22 -07:00
Xaekai f89832a6d1 Gracefully allow script authors time to update their code 2017-06-15 22:09:09 -07:00
Xaekai df0fc769d9 Single source of truth for AFK
Resolves #678
2017-06-15 21:48:17 -07:00
Calvin Montgomery 8306d2d1b6 Refactor logging 2017-04-04 23:02:31 -07:00
Calvin Montgomery 9239c2d465 Add channels.owner_last_seen column 2017-03-13 21:05:32 -07:00
Calvin Montgomery 8f266ccd44 Add channels.last_loaded column 2017-03-13 20:55:06 -07:00
Calvin Montgomery aea456436e Fix race condition for siteadmin rank socket frames 2017-03-03 23:34:27 -08:00
Calvin Montgomery d4db459ff9 Fix #647 2017-03-01 20:46:01 -08:00
Calvin Montgomery 7c3f2d0a8b only set channel rank for non-guest 2016-10-06 23:22:02 -07:00
Calvin Montgomery ad4ee4bd02 Fix profile/rank for bot logins 2016-10-06 23:01:42 -07:00
Calvin Montgomery 99760b6989 Purge the awful refreshAccount logic
User.prototype.refreshAccount was responsible for multiple race
condition bugs as well as inefficient duplication of DB queries in an
attempt to correct such race conditions.

It has now been replaced by a more reasonable model:

  * Global user account information and aliases are fetched in parallel
    on socket connection
  * Channel rank is fetched when the user tries to join a channel
2016-10-03 23:12:22 -07:00
Calvin Montgomery e1120455b2 Cache channel ID for quicker loads/saves 2016-09-26 22:20:58 -07:00
Calvin Montgomery edff85dfb0 Fix User#inChannel for channels with passwords 2016-09-17 15:02:30 -07:00
Calvin Montgomery 8b94c54d25 Fix bug causing channels to get stuck when DB is down 2016-08-31 21:32:42 -07:00
calzoneman 312892e56b Short term additional fix for #583
The previous commits do not handle all of the edge cases of #583
appropriately.  This is a short term solution that will work, but is not
as efficient as it could be.  The whole refreshAccount function needs to
be reconsidered and replaced with a more sane way of handling atomic
updates to the user's account state.
2016-06-29 22:00:25 -07:00
calzoneman c70dc83504 Fix previous fix 2016-06-26 21:15:33 -07:00
calzoneman e9fdb1a7e5 Fix login race condition (#583) 2016-06-26 16:21:15 -07:00
calzoneman 056b2a48ea Add throttling of usercount frames 2016-06-18 00:32:50 -07:00
calzoneman 0ee7f05213 Make polls more efficient
Instead of emitting frames to each individual socket, group them into
socket.io rooms of people who can see hidden poll results and people who
can't, then just do 2 broadcasts.
2016-04-02 11:57:26 -07:00
calzoneman 20538e328f Replace legacy emitter with EventEmitter prototype 2016-04-02 11:23:34 -07:00
calzoneman 76ef8d6906 Improve performance of mass connects by broadcasting usercount 2016-02-15 21:35:59 -08:00
calzoneman 1ac69709ee Minor fix to refcounter logic 2016-01-04 20:35:02 -08:00
calzoneman be4011cda1 Replace old ActiveLock system with a slightly better one
CyTube has been crashing recently due to things attempting to release
the reference after the channel was already closed (apparently the
uncaughtException handler isn't called for this?).  This newer
implementation keeps track of what is ref'ing and unref'ing it, so it
can log an error if it detects a discrepancy.

Also changed the server to not delete the refCounter field from the
channel when it's unloaded, so that should reduce the number of errors
stemming from it being null/undefined.
2015-12-25 17:07:25 -08:00
calzoneman b4e7ab2443 Don't save a channel if it hasn't loaded yet 2015-12-18 19:20:57 -08:00
calzoneman 6f654b16b8 Prevent crash due to activeLock being destroyed before callback 2015-12-13 00:22:18 -08:00
calzoneman 2fe646ec03 Minor cleanup 2015-10-04 23:21:53 -07:00
calzoneman 20dc871303 Use create-error for better error creation 2015-09-24 23:36:05 -07:00
calzoneman 5ec9c2b029 Start refactoring channel storage 2015-09-23 21:56:04 -07:00
calzoneman 0109a87e55 package: build with babel for ES2015 support
* Rename lib/ -> src/
* Add `postinstall` npm target for compiling src files to lib
* Add `build-watch` npm target for development with babel --watch
* Add `lib/` to .gitignore
* Add `source-map-support` module for babel-generated sourcemaps
2015-09-23 19:27:04 -07:00
Renamed from lib/channel/channel.js (Browse further)