Commit Graph

41 Commits

Author SHA1 Message Date
Peter Jaszkowiak
707b55b6a5 chore: eslint prefer-template 2021-02-08 18:06:44 -05:00
Barış Soner Uşaklı
47299ea587 Categories refactor (#9257)
* feat: wip categories pagination

* feat: add subCategoriesPerPage setting

* feat: add load more sub categories button to category page

* fix: openapi spec

* feat: show sub categories left on category page

hide button when no more categories left

* breaking: rename categories to allCategories on /search

categories contains the search results

* fix: spec

* refactor: remove cidsPerPage

* fix: tests

* feat: use component for subcategories

* fix: prevent negative subCategoriesLeft

* feat: new category filter/search WIP

* feat: remove categories from /tag

* fix: dont load all categories when showing move modal

* feat: allow adding custom categories to list

* breaking: dont load entire category tree on post queue

removed unused code
add hooks to filter/selector
add options to filter/selector

* feat: make selector modal work again

* feat: replace old search module

* fix: topic move selector

* feat: dont load all categories on create category modal

* fix: fix more categorySelectors

* feat: dont load entire category tree on group details page

* feat: dont load all categories on home page and user settings page

* feat: add pagination to /user/:userslug/categories

* fix: update schemas

* fix: more tests

* fix: test

* feat: flags page, dont return entire category tree

* fix: flag test

* feat: categories manage page

dont load all categories
allow changing root category
clear caches properly

* fix: spec

* feat: admins&mods page

dont load all categories

* fix: spec

* fix: dont load all children when opening dropdown

* fix: on search results dont return all children

* refactor: pass all options, rename options.cids to options.selectedCids

* fix: #9266

* fix: index 0

* fix: spec

* feat: #9265, add setObjectBulk

* refactor: shoter updateOrder

* feat: selectors on categories/category

* fix: tests and search filter

* fix: category update test

* feat: pagination on acp categories page

show order in set order modal

* fix: allow drag&drop on pages > 1 in /admin/manage/categories

* fix: teasers for deep nested categories

fix sub category display on /category page

* fix: spec

* refactor: use eslint-disable-next-line

* refactor: shorter
2021-02-07 15:09:52 -05:00
Barış Soner Uşaklı
33bf1b0e2c feat: async/await psql connection 2021-01-22 22:10:34 -05:00
Barış Soner Uşaklı
1c45fa1ba5 feat: socket.io 3 changes (#8845)
* feat: socket.io 3 changes

* feat: replace socketio-wildcard with socket.onAny

up socket.io-redis to 6.x

* feat: remove mongodb/psql socket.io adapters

* feat: show data on fail

* fix: tests

* fix: typo

* fix: logger test fix

* fix: logger.io_close

* chore: up deps

* chore: update readme to reflect redis requirement

* fix: increase timeout show data if test fails
2020-12-06 13:03:33 -05:00
Barış Soner Uşaklı
5bb5ec4618 fix: #8954, clear purged replies and toPids (#8959)
* fix: #8954, clear purged replies and toPids

* fix: redis test
2020-11-26 12:04:01 -05:00
Timothy Fike
5078a8df25 ttl/pttl (#8689) 2020-09-27 22:10:46 -04:00
Barış Soner Uşaklı
4be693f2e7 feat: fullname search (#8641)
* feat: fullname search

* fix: take last element

* fix: attempt to fix psql like query

* feat: upgrade sript, another fix attempt

* fix: psql test

* fix: psql scan

* feat: add debug for test

* feat: test collate

* feat: cleanup

* fix: upgrade script
2020-09-11 23:20:49 -04:00
Barış Soner Uşaklı
2d5bd153e0 fix: check if unread_tids are followed 2020-09-11 00:39:45 -04:00
Barış Soner Uşaklı
e95cd28f6f Zscan (#8458)
* feat: zscan

* fix: mongodb tests

* feat: scan, ip search starts with
2020-07-02 20:11:53 -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ı
e80379dc0e feat: display stack trace on winston.error 2020-06-20 23:32:12 -04:00
Barış Soner Uşaklı
0009f54e6e feat: add getSortedSetMembers 2020-05-26 22:55:28 -04:00
Barış Soner Uşaklı
edf9fe3b7f feat: add null tests for sorted sets 2020-05-09 10:38:56 -04:00
Ben Lubar
f65922297d fix abysmal postgresql performance in getSortedSetsMembers (#8030)
* refactor postgres upgrade function to use async

* add function wrapper for getting the elements of a sorted set to avoid postgres planning the query with a nested sequential scan

* fix fatal(?!) lint errors

* add missing await

* bump PostgreSQL version on Travis CI to one that isn't over 3 years out of date
2019-11-13 14:45:48 -05:00
Baris Usakli
77cb4b55cb fix: #7892, handle string 'true'/'false' 2019-09-10 13:56:57 -04:00
David Karrick
9b4ae4c04a Added Postgres SSL Support (#7887)
* [Added] Postgres SSL Support

* [Added]Postgres SSL Support

* [Added] Postgres SSL Support
2019-09-07 13:27:51 -04:00
Barış Soner Uşaklı
1e0190abef fix: #7842, groups.invite works with an array of uids 2019-08-18 21:51:32 -04:00
Barış Soner Uşaklı
8d4f20865f fix: redis pubsub not being required correctly
split connection logic into separate module
2019-08-06 18:27:00 -04:00
Barış Soner Uşaklı
af1f7249a7 feat: test psql without defineProperty (#7815)
* feat: test psql without defineProperty

* feat: refactor psql

remove .bind calls, use module.pool.query directly
move requires to top of file
move promisify to bottom so .init etc are promisified

* feat: mongodb

move requires to bottom

* feat: redis
2019-08-05 09:20:00 -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
8d319e4280 fix: psql error 2019-05-31 16:37:46 -04:00
Baris Usakli
2e6b562f1e fix: try to fix psql 🐶 2019-05-31 16:14:51 -04:00
Baris Usakli
31ccc860d3 feat: allow multiple scores in sortedSetsAdd 2019-05-31 15:44:50 -04:00
Barış Soner Uşaklı
4d9bc30d1f feat: async3 upgrade (#7639)
* feat: async3 upgrade WIP

* fix: async.doWhilst

* fix: async early exit

* fix: psql doUntil

* fix: psql again
2019-05-30 14:36:33 -04:00
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
Peter Jaszkowiak
e1ca2d81f9 refactor: use loash when possible (#7230) 2019-01-12 14:28:53 -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
Barış Soner Uşaklı
1c981e638b rename query name 2018-11-21 21:10:56 -05:00
Barış Soner Uşaklı
ca1e3a758b #6986 2018-11-21 20:40:40 -05:00
Barış Soner Uşaklı
9724ef083e remove v from query 2018-09-24 16:59:12 -04:00
Barış Soner Uşaklı
786311fa64 use value 2018-09-24 16:58:35 -04:00
Barış Soner Uşaklı
5a69f979a8 update processSortedSet to use withScores 2018-09-24 16:57:19 -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