140 Commits (36895421ba0f8ceae21efbaa324ac8da4794602a)

Author SHA1 Message Date
Barış Soner Uşaklı fafa130406
chore: up connect-redis to 7.x, drop node 14 (#11376) 2 years ago
Barış Soner Uşaklı 6659e95a4a
refactor: remove promisify from redis, ioredis supports promises nati… (#9728)
* refactor: remove promisify from redis, ioredis supports promises natively

* refactor: remove unused util
4 years ago
Barış Soner Uşaklı a3d6c56ec3 feat: #9551 4 years ago
Peter Jaszkowiak b56d9e12b5 chore: eslint prefer-arrow-callback 4 years ago
Peter Jaszkowiak 707b55b6a5 chore: eslint prefer-template 4 years ago
Barış Soner Uşaklı 5bc1f5b4e8 fix: #9231, fix redis pubsub connection
regression from fdfbc90255
4 years ago
Barış Soner Uşaklı 78896fc623 fix: redis check compat tests 4 years ago
Barış Soner Uşaklı fdfbc90255 feat: async/await redis connection 4 years ago
Barış Soner Uşaklı b8cafefce2 fix: winston usages 4 years ago
Barış Soner Uşaklı 896fe9d65e fix: don't crash on outdated redis instances 5 years ago
Barış Soner Uşaklı ce6b20c4b7 feat: remove topics.async.getTopicData usage 5 years ago
Barış Soner Uşaklı e80379dc0e feat: display stack trace on winston.error 5 years ago
Julian Lam ccc6118d30
Testing suite integration for openapi spec (#8263)
* feat: testing suite integration for openapi spec

The testing suite now takes the openapi spec into account. It will
check each route defined, make a call to it, and compare the
response with the defined schema. Any mismatches will cause the
test to fail.

* fix(openapi): removed debug stuff from tests

* fix(openapi): fixed some tests

* fix(openapi): added additional check to tests, test fixes

* fix(openapi): better tests, fixed spec errors

* fix(openapi): bad conditional in test

* fix: oops

* fix(openapi): more tests fixing

* fix(openapi): more tests

* fix(openapi): fix some more tests

* fix: verbose'd an info log

* fix: topic pagination route returns schema-optimized pagination block

* fix(openapi): more test/spec fixes

* fix(openapi): accidentally sending in authenticated jar for anon routes

* fix(openapi): more test/spec fixes

* fix(openapi): more spec fixes

* fix: timestampReadable Invalid Date

* fix(openapi): more tests... almost there

* fix(openapi): more tests fixing

* fix(openapi): finally all tests passing

* fix(openapi): added reverse test to compare response to spec

... and fixed all the tests that broke

* fix: remove tests related to group covers, as route is gone

* fix(openapi): broken test on travis

* fix(openapi): broken test on travis

* fix(openapi): broken test on travis

* fix(openapi): object cache is not present for psql

* fix: tests

Co-authored-by: Barış Soner Uşaklı <[email protected]>
5 years ago
Barış Soner Uşaklı 8d4f20865f fix: redis pubsub not being required correctly
split connection logic into separate module
6 years ago
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
6 years ago
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 cea206a9b8e6d8295310074b18cc82a504487862.

* 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
6 years ago
Barış Soner Uşaklı 2e2c3ac110 fix: #7352 6 years ago
Barış Soner Uşaklı 26ccd8f626 fix: db info page
if there is no connection to db, connect first
6 years ago
Barış Soner Uşaklı 6330d51446 less derpy output 6 years ago
Barış Soner Uşaklı ed1bf9a16f add more info to advanced db page 6 years ago
Barış Soner Uşaklı 0524fd9caa
closes #6996 (#6997)
* closes #6996

* fix lint
6 years ago
Barış Soner Uşaklı 0519f84734
Promisify modules (#6723)
* WIP promisify

* promisify psql

* ability to skip some keys

* dont promisify client object

* remove async

* clone entire module so it has all properties

* add shim for node 6

* ignore sessionStore as well

* ignore pool on psql
7 years ago
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.
7 years ago
Barış Soner Uşaklı 77d47b31fb cleanly shutdown
wait for webserver to stop accepting connections
destroy current connections
wait for db connection to close
7 years ago
Baris Usakli 3c4b4f5263 don't call calback twice #6375 7 years ago
Barış Soner Uşaklı 8a6345ded7 possible fix for pubsub 7 years ago
Ben Lubar e85aabbe74 Allow running as a cluster without Redis (#6233)
* [database/*] Allow databases other than Redis to provide pubsub for clustering if Redis is not present

* [pubsub] Delay messages sent before the database is ready until the database is ready.

* [pubsub] Restore old behavior of not using the database in non-clustered NodeBB instances.

See comment: https://github.com/NodeBB/NodeBB/pull/6233#issuecomment-357814968
7 years ago
Barış Soner Uşaklı e092778ba6 closes #6200 7 years ago
Peter Jaszkowiak e609e497b3 Provide more error information to logs
Provides full stack instead of just message
7 years ago
Baris Usakli 7fe239229d show 3 digits 8 years ago
Peter Jaszkowiak 3c2d4fe649 Switch from underscore to lodash 8 years ago
Barış Soner Uşaklı fd0043f36a more tests 8 years ago
barisusakli b91b41dfa3 show database values in gbs 8 years ago
barisusakli ba51a6c746 fix underscore 8 years ago
barisusakli a2784738a4 fix lint 8 years ago
barisusakli 2029de4cc5 closes #5449 8 years ago
barisusakli 3d39a577f4 style change 8 years ago
barisusakli 65a65b19c0 tests for #5600 8 years ago
barisusakli 185b6e5c8e #5600 8 years ago
Peter Jaszkowiak 4bb49a7171 ESlint no-unused-vars 8 years ago
Peter Jaszkowiak 3b0dd2d1ef ESlint padded-blocks 8 years ago
Peter Jaszkowiak a038c66549 ESlint quotes 8 years ago
Peter Jaszkowiak b1b486f729 ESlint quote-props 8 years ago
Peter Jaszkowiak 1cf25f57fc ESlint no-space-func 8 years ago
Peter Jaszkowiak bc1d70c126 ESlint comma-dangle 8 years ago
Dominic Lennon a06e39528f Code review change 8 years ago
Dominic Lennon ed19454eca Adding more specific timing for session timings 8 years ago
Dominic Lennon d248ef95cd Fix for issue #5334. SessionStore now uses the correct value 8 years ago
Barış Soner Uşaklı e0501656b6 parallel startup 8 years ago
Barış Soner Uşaklı 8c8e2ae190 closes #5271 8 years ago