Commit Graph

114 Commits

Author SHA1 Message Date
Barış Soner Uşaklı
2c98dd5f9d Object cache refactor (#7558)
* fix: cache refactor

db.getObjectField no longer loads entire object
db.getObjectsFields only clones data once
more tests

* feat: add back cache to redis

db.getObjectField no longer loads entire object
2019-04-24 14:38:46 -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ı
3917022a48 fix: #7139 2018-12-19 11:09:19 -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ı
ca1e3a758b #6986 2018-11-21 20:40:40 -05:00
Barış Soner Uşaklı
f8e219c323 handle empty set, add test 2018-11-11 15:39:17 -05:00
Barış Soner Uşaklı
75816deca7 add cache to redis (#6917)
* add cache to redis

move out cache module from mongo

* fix redis tests

* add callback noop

* fix typo

* del cache on field delete

* make redis/mongo caches separate
2018-11-07 15:04:56 -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ı
f3a679e268 remove parseInts 2018-10-25 17:02:59 -04:00
Barış Soner Uşaklı
c738dc7d3e remove some more parseInts 2018-10-22 21:58:34 -04:00
Barış Soner Uşaklı
e615391b22 convert values to string before removing 2018-10-11 16:23:05 -04:00
Barış Soner Uşaklı
18d0deeccb update deprecated methods (#6794) 2018-09-26 15:02:57 -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ı
be5c237388 fix decr/incrObjectField if key in array doesn't exist create it 2018-03-17 19:08:52 -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
Barış Soner Uşaklı
7221b71b68 add test for srem with multi elements 2018-03-16 19:07:37 -04:00
Baris Usakli
959a742c63 add llen to dbal 2018-03-15 12:06:40 -04:00
Barış Soner Uşaklı
bce640e514 closes #6340 2018-03-03 12:31:27 -05:00
Barış Soner Uşaklı
7a2d6fe22d Merge remote-tracking branch 'refs/remotes/origin/master' into develop 2018-02-02 10:36:25 -05:00
Barış Soner Uşaklı
b084a596fa closes #6301 2018-02-01 14:33:06 -05: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ı
87d40e9e78 fix increment to use data 2018-01-03 14:24:07 -05:00
Barış Soner Uşaklı
8e04e86e24 closes #5912 2017-12-07 20:43:07 -05:00
Baris Usakli
dbf815ed47 closes #6103 2017-11-22 12:10:40 -05:00
Baris Usakli
5604c62776 use the first set for sorting 2017-11-08 16:32:34 -05:00
Barış Soner Uşaklı
e7318a1cea Mongo cache (#6002)
* cache mongodb objects

remove user settings cache since it is cached at the object level

* removed indexOf from isMemberOfSets

* change has to get, change maxAge to 0
2017-10-23 18:31:16 -04:00
Barış Soner Uşaklı
108f84fd19 add type to dbal 2017-10-20 13:51:07 -04:00
Barış Soner Uşaklı
329bfeeb3b convert min/max to float 2017-08-20 20:41:31 -04:00
Barış Soner Uşaklı
5a55c882ab convert NaN uids to 0 2017-06-01 16:17:08 -04:00
Barış Soner Uşaklı
f1b8492164 remove unnecessary checks 2017-05-27 00:30:07 -04:00
Peter Jaszkowiak
b171f3072b Fix many "duplicate key" errors
- Reset defaults after every test
- Remove individual `after(db.emptydb)` calls
- Fix async.every in groups test
- Update plugin list in socket tests
2017-05-26 17:16:59 -06:00
Barış Soner Uşaklı
fe0a5aaf28 fix redis tests 2017-05-19 20:32:31 -04:00
Barış Soner Uşaklı
fd0043f36a more tests 2017-05-19 20:24:54 -04:00
Barış Soner Uşaklı
95196ceedc closes #5692 2017-05-19 14:52:36 -04:00
Barış Soner Uşaklı
4ab514a422 test for .delete with zset 2017-05-18 16:59:37 -04:00
barisusakli
d8170d5d1c fix tests 2017-04-19 13:09:16 -04:00
barisusakli
4d1b8d7460 fix lint 2017-04-14 15:15:25 -04:00
barisusakli
92343eb2e1 fix mongo setObject if key/value is empty string 2017-04-14 13:58:32 -04:00
barisusakli
7ce6c1d0ad closes #5571 2017-04-13 16:36:02 -04:00
Peter Jaszkowiak
896c8c7343 ESlint object-curly-spacing 2017-02-18 12:30:49 -07:00
Peter Jaszkowiak
3b0dd2d1ef ESlint padded-blocks 2017-02-18 02:32:24 -07:00
Peter Jaszkowiak
2e031f3759 ESlint comma-spacing 2017-02-18 01:31:47 -07:00