Commit Graph

68 Commits

Author SHA1 Message Date
Barış Soner Uşaklı
9b901783fa Chat refactor (#11779)
* first part of chat refactor

remove per user chat zsets & store all mids in chat:room:<roomId>:mids
reverse uids in getUidsInRoom

* feat: create room button

public groups wip

* feat: public rooms

create chats:room zset
chat room deletion

* join socket.io room

* get rid of some calls that load all users in room

* dont load all users when loadRoom is called

* mange room users infinitescroll

dont load all members in api call

* IS for user list

ability to change groups field for public rooms
update groups field if group is renamed

* test: test fixes

* wip

* keep 150 messages

* fix extra awaits

fix dupe code in chat toggleReadState

* unread state for public rooms

* feat: faster push unread

* test: spec

* change base to harmony

* test: lint fixes

* fix language of chat with message

* add 2 methods for perf

messaging.getTeasers and getUsers(roomIds)
instead of loading one by one

* refactor: cleaner conditional

* test fix upgrade script fix

save timestamp of room creation in room object

* set progress.total

* don't check for guests/spiders

* public room unread fix

* add public unread counts

* mark read on send

* ignore instead of throwing

* doggy.gif

* fix: restore delete

* prevent entering chat rooms with

meta.enter

* fix self message causing mark unread

* ability to sort public rooms

* dont init sortable on mobile

* move chat-loaded class to core

* test: fix spec

* add missing keys

* use ajaxify

* refactor: store some refs

* fix: when user is deleted remove from public rooms as well

* feat: change how unread count is calculated

* get rid of cleaned content

get rid of mid

* add help text

* test: fix tests, add back mid

to prevent breaking change

* ability to search members of chat rooms

* remove

* derp

* perf: switch with  partial data

fix tests

* more fixes

if user leaves a group leave public rooms is he is no longer part of any of the groups that have access

fix the cache key used to get all public room ids

dont allow joining chat socket.io room if user is no longer part of group

* fix: lint

* fix: js error when trying to delete room after switching

* add isRoomPublic
2023-07-12 13:03:54 -04:00
Barış Soner Uşaklı
f083cd559d feat: add getSortedSetMembersWithScores (#11579)
* feat: add getSortedSetMembersWithScores

* lint: fix

* test: fix redis

* fix: mongo/psql
2023-05-07 22:32:05 -04:00
Barış Soner Uşaklı
6bed65dde6 fix: numeric strings in mongo (#11498) 2023-04-19 17:16:45 -04:00
Barış Soner Uşaklı
56427e4f9d fix: closes #11343, don't crash if tags array is empty 2023-03-10 11:40:02 -05:00
CommanderRoot
200f0b2e4f refactor: replace deprecated String.prototype.substr() (#10432)
.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated

Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
2022-03-31 13:49:56 -04:00
Julian Lam
606808760e test: add test to verify that a sorted set is automatically deleted if its last element is removed (#10261)
* test: add test to verify that a sorted set is automatically deleted if its last element is removed

* fix: remote empty zsets when all elements have been removed #yolo

* Revert "fix: remote empty zsets when all elements have been removed #yolo"

This reverts commit 0ac73244bb.

* fix: altered behaviour in module.exists instead of zrem
2022-02-07 17:16:50 -05:00
Barış Soner Uşaklı
6ea3b51f12 Zincrybulk (#9975)
* feat: zincry bulk

* feat: psql bulk incr placeholder

* test: redis test fix

* test: redis test
2021-11-30 19:59:47 -05:00
Barış Soner Uşaklı
4359e5c97c refactor: remove tabs after declaration 2021-11-16 16:24:17 -05:00
Barış Soner Uşaklı
e6a17a6349 Psql multikey (#9852)
* perf: convert promise.all to single query

* perf: single query for removeBulk

* perf: list
2021-10-01 19:36:42 -04:00
Barış Soner Uşaklı
e59d357533 feat: als (#9749)
* feat: als

* fix: up test timeout

* fix: don't overwrite caller if it already exists

* fix: up test timeout for psql
2021-08-30 10:23:38 -04:00
Peter Jaszkowiak
dab3b23575 chore: eslint no-var, vars-on-top 2021-02-08 18:06:44 -05:00
Peter Jaszkowiak
b56d9e12b5 chore: eslint prefer-arrow-callback 2021-02-08 18:06:44 -05:00
Peter Jaszkowiak
707b55b6a5 chore: eslint prefer-template 2021-02-08 18:06:44 -05:00
Barış Soner Uşaklı
0d7dfeeb86 chore: increase test timeout 2021-01-04 17:09:14 -05:00
Barış Soner Uşaklı
9389749b79 feat: sorted set lex test 2020-09-11 21:12:49 -04:00
Barış Soner Uşaklı
723fe8e8e0 feat: zscan (#8457)
* feat: zscan

* fix: mongodb tests
2020-07-02 17:59:20 -04:00
Barış Soner Uşaklı
0009f54e6e feat: add getSortedSetMembers 2020-05-26 22:55:28 -04:00
Barış Soner Uşaklı
3b6d57e497 refactor: move code 2020-05-21 22:20:01 -04:00
Barış Soner Uşaklı
4ee3543ea4 feat: tweak intersection code, add tests 2020-05-21 22:12:58 -04:00
Barış Soner Uşaklı
12c6bc2e07 feat: convert queries so they used indices directly 2020-05-19 00:22:54 -04:00
Barış Soner Uşaklı
edf9fe3b7f feat: add null tests for sorted sets 2020-05-09 10:38:56 -04:00
Barış Soner Uşaklı
310c6fd33f properly filter /unread /recent /popular /top (#7927)
* feat: add failing test for pagination

* feat: test

* fix: redis tests

* refactor: remove logs

* fix: add new test

* feat: make sortedSetRangeByScore work with keys on redis

* fix: hardcoded set name

* feat: show topics from readable categories on recent/popular/top

* feat: rewrite unread topics

respect watched categories and followed topics

* fix: term + watched
2019-09-26 21:55:49 -04:00
Barış Soner Uşaklı
22b02f1407 feat: add failing test for pagination (#7924)
* feat: add failing test for pagination

* feat: test

* fix: redis tests

* refactor: remove logs
2019-09-25 21:06:57 -04:00
Barış Soner Uşaklı
b602c04463 feat: refactor getSortedSetRange to allow big arrays 2019-09-24 23:47:45 -04:00
Baris Usakli
1e5246f9ad feat: add new test 2019-09-24 13:31:44 -04:00
Barış Soner Uşaklı
53e1b349ae Change post owner (#7752)
* feat: #7749, allow array of keys for setObject

* feat: sortedSetRemoveBulk

* feat: test for bulk remove

* feat: #7083, ability to change post ownership

* feat: #7083, fix tid:<tid>:posters

* feat: #7083, front end

* fix: #7752, psql methods

* fix: add missing await

* fix: maybe psql
2019-07-12 14:06:09 -04:00
Barış Soner Uşaklı
805dcd7ca2 Async refactor in place (#7736)
* feat: allow both callback&and await

* feat: ignore async key

* feat: callbackify and promisify in same file

* Revert "feat: callbackify and promisify in same file"

This reverts commit cea206a9b8.

* feat: no need to store .callbackify

* feat: change getTopics to async

* feat: remove .async

* fix: byScore

* feat: rewrite topics/index and social with async/await

* fix: rewrite topics/data.js

fix issue with async.waterfall, only pass result if its not undefined

* feat: add callbackify to redis/psql

* feat: psql use await

* fix: redis 🌋

* feat: less returns

* feat: more await rewrite

* fix: redis tests

* feat: convert sortedSetAdd

rewrite psql transaction to async/await

* feat: 🐶

* feat: test

* feat: log client and query

* feat: log bind

* feat: more logs

* feat: more logs

* feat: check perform

* feat: dont callbackify transaction

* feat: remove logs

* fix: main functions

* feat: more logs

* fix: increment

* fix: rename

* feat: remove cls

* fix: remove console.log

* feat: add deprecation message to .async usage

* feat: update more dbal methods

* fix: redis :voodoo:

* feat:  fix redis zrem, convert setObject

* feat: upgrade getObject methods

* fix: psql getObjectField

* fix: redis tests

* feat: getObjectKeys

* feat: getObjectValues

* feat: isObjectField

* fix: add missing return

* feat: delObjectField

* feat: incrObjectField

* fix: add missing await

* feat: remove exposed helpers

* feat: list methods

* feat: flush/empty

* feat: delete

* fix: redis delete all

* feat: get/set

* feat: incr/rename

* feat: type

* feat: expire

* feat: setAdd

* feat: setRemove

* feat: isSetMember

* feat: getSetMembers

* feat: setCount, setRemoveRandom

* feat: zcard,zcount

* feat: sortedSetRank

* feat: isSortedSetMember

* feat: zincrby

* feat: sortedSetLex

* feat: processSortedSet

* fix: add mising await

* feat: debug psql

* fix: psql test

* fix: test

* fix: another test

* fix: test fix

* fix: psql tests

* feat: remove logs

* feat: user arrow func

use builtin async promises

* feat: topic bookmarks

* feat: topic.delete

* feat: topic.restore

* feat: topics.purge

* feat: merge

* feat: suggested

* feat: topics/user.js

* feat: topics modules

* feat: topics/follow

* fix: deprecation msg

* feat: fork

* feat: topics/posts

* feat: sorted/recent

* feat: topic/teaser

* feat: topics/tools

* feat: topics/unread

* feat: add back node versions

disable deprecation notice
wrap async controllers in try/catch

* feat: use db directly

* feat: promisify in place

* fix: redis/psql

* feat: deprecation message

logs for psql

* feat: more logs

* feat: more logs

* feat: logs again

* feat: more logs

* fix: call release

* feat: restore travis, remove logs

* fix: loops

* feat: remove .async. usage
2019-07-09 12:46:49 -04:00
Barış Soner Uşaklı
bd640a1107 Topic await errors (#7727)
* feat: derp await

* feat: restore user.getSettings

* feat: cleanup

* feat: make tid const

* feat: cleanup

* fix: tests

* feat: deprecate filter:controllers.topic.get

* feat: rewrite post-index logic

* feat: change calculation to match others

* fix: use .async

* feat: remove try/catch wrapper
2019-07-03 12:48:26 -04:00
Barış Soner Uşaklı
3ecd703ea3 feat: #7707, added sortedSetAddBulk 2019-06-24 17:48:13 -04:00
Barış Soner Uşaklı
a39f0ef592 fix: #5570, create per category user post zsets 2019-06-24 15:21:43 -04:00
Baris Usakli
31ccc860d3 feat: allow multiple scores in sortedSetsAdd 2019-05-31 15:44:50 -04:00
Barış Soner Uşaklı
5917dec288 fix: only allow numbers as scores (#7356)
* zadd score checks

* fix: only allow numbers as scores

* fix: convert values to strings
2019-02-11 11:23:18 -05:00
Barış Soner Uşaklı
fef7e13c9e feat: small fixes 2018-12-17 18:56:09 -05:00
Barış Soner Uşaklı
eb7ae54f81 Category watch state (#7109)
* feat: wip, category watch change

* feat: pass data to client

* feat: allow changing state

* fix: account page categories

* fix: show in unread if topic is followed or category is watched

* feat: add default watch state to acp

* feat: save user category watch state

* feat: update unread recent pages

* fix: remove dupe code

* fix: flip conditions

* fix: handle empty arrays

* fix: ignore/watch on others profile

* feat: upgrade script for category states

if there are any users ignoring categories set their state in new zset and delete cid:<cid>:ignorers

* fix: upgrade

* fix: tests

* fix: redis count

* fix: more tests
2018-12-14 16:24:17 -05:00
Barış Soner Uşaklı
263c918088 feat: remove uid:<uid>:ignored:cids (#7099)
use cid:<cid>:ignorers instead
2018-12-12 11:15:34 -05:00
Baris Usakli
e65d40c937 dont return undefined from sortedSetsCard if keys is empty or falsy 2018-12-07 16:50:35 -05:00
Baris Usakli
76af8caf58 add missing semicolon 2018-12-07 16:19:47 -05:00
Baris Usakli
420227faae parseFloat scores 2018-12-07 16:01:08 -05:00
Barış Soner Uşaklı
53ad2bbd6e Categories optimize (#6999)
* WIP

* fix category page

* fix counts, and copyPrivileges

* fix lint

* more fixes,

* redis fix

* fix test

* fix  category test

* remove getParentsAndChildren
2018-11-25 19:08:38 -05:00
Barış Soner Uşaklı
f8e219c323 handle empty set, add test 2018-11-11 15:39:17 -05:00
Barış Soner Uşaklı
7aa937a657 remove dupe code in mongodb sorted 2018-10-28 16:20:38 -04:00
Barış Soner Uşaklı
e615391b22 convert values to string before removing 2018-10-11 16:23:05 -04:00
Ben Lubar
33228bb7fe PostgreSQL database driver (#5861)
* [test/database/list] Fix test list 4 being used in two different tests

* [database/postgres] PostgreSQL database driver

* [database/postgres] Make transactions work based on continuation scope.

* [database/postgres] Implement nested transactions

* eslint --fix

* Add database changes from earlier this week to the PostgreSQL driver.

* Fix typo

* Fix postgres.incrObjectFieldBy returning undefined instead of null when given NaN

* [database/postgres] Fix sortedSetsCard returning an array of strings.

* Update socket.io postgres adapter

* Fix PostgreSQL erroring when multiple updates are made to the same sorted set entry in a single operation.

Add a test case to catch this error.

* Fix lint errors.

* Only prune sessions on one instance in a cluster to avoid deadlocks.

They're caught and handled by the database server, but they spam the logs.

* Fix arguments.slice.
2018-08-08 15:13:48 -04:00
Barış Soner Uşaklı
c3fc4a06bf test sortedSetUnion with scores 2018-06-14 17:24:29 -04:00
Barış Soner Uşaklı
fde44cb9b9 pass array to groups.destroy
pass array to db.sortedSetRemove
2018-03-17 19:55:23 -04:00
Barış Soner Uşaklı
6a9a73c86c changes to leaveAllGroups
Groups.destroy can take an array of groupnames
Groups.leave can take an array of groupnames
db.incrObjectField/decrObjectField can take an array of keys
db.sortedSetRemove can take an array of keys and values
db.setRemove can take an array of keys
2018-03-17 18:49:38 -04:00
Ben Lubar
5b1ed21634 [database/mongo] Improve speed of sortedSetRank (#6229)
* [database/mongo] Improve speed of sortedSetRank

* [database/mongo] Fix sortedSetRank to filter by _key
2018-01-12 13:32:07 -05:00
Barış Soner Uşaklı
8e04e86e24 closes #5912 2017-12-07 20:43:07 -05:00
Baris Usakli
5604c62776 use the first set for sorting 2017-11-08 16:32:34 -05:00
Barış Soner Uşaklı
329bfeeb3b convert min/max to float 2017-08-20 20:41:31 -04:00