Commit Graph

691 Commits

Author SHA1 Message Date
Barış Soner Uşaklı
56427e4f9d fix: closes #11343, don't crash if tags array is empty 2023-03-10 11:40:02 -05:00
Julian Lam
9b753d6d57 TTL Cache (#10816)
* refactor: move src/cacheCreate.js to src/cache/lru.js

* fix: call new library location for lru cache creator

* feat: add ttl cache

* fix: update upload throttler to use ttl cache instead of lru cache

* chore: add missing dependency

* fix: avoid pubsub conflicts

* fix: use get instead of peek, which is not available in ttl-cache
2022-08-10 15:26:07 -04:00
Julian Lam
c07d595662 Update to lru-cache@^7 (#10815)
* chore(deps): bump lru-cache from 6.0.0 to 7.13.1 in /install

Bumps [lru-cache](https://github.com/isaacs/node-lru-cache) from 6.0.0 to 7.13.1.
- [Release notes](https://github.com/isaacs/node-lru-cache/releases)
- [Changelog](https://github.com/isaacs/node-lru-cache/blob/main/CHANGELOG.md)
- [Commits](https://github.com/isaacs/node-lru-cache/compare/v6.0.0...v7.13.1)

---
updated-dependencies:
- dependency-name: lru-cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix(lru-cache): remove unneeded `length` params for cache creation, as `maxSize` was not used in those init calls, also renamed some methods to match new method names in lru-cache [breaking]

Added deprecation notices for old params

* fix: replace three direct calls to lru-cache with call to cacheCreate, moved cache creation call in uploads to run on first init as config is not populated at lib init

* test: move configs init above cache reset calls in databasemock

* move some more code above cache clear

* refactor: remove unused

* test: lru

* test: more debug

* test: on more test

* use await helpers.uploadFile

* fix: tests remove logs

* fix: acp cache page

* fix: add in one more guard again cache instantiation with `length` prop but no `maxSize` prop

* fix(deps): bump markdown

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Barış Soner Uşaklı <barisusakli@gmail.com>
2022-08-10 13:24:16 -04:00
Barış Soner Uşaklı
82389469f6 feat: make it simpler to use redis sentinels 2022-04-22 15:39:27 -04:00
Barış Soner Uşaklı
767973717b perf: WIP #10449, allow array of pids for posts.purge (#10465)
* perf: WIP #10449, allow array of pids for posts.purge

* refactor: deletePostDiffs

* perf: deletePostFromReplies/deletePostFromGroups

* refactor: upload

* refactor: deleteFromCategoryRecentPosts

deleteFromUsersBookmarks
deleteFromUsersVotes

* feat: closes #10468, add incrObjectFieldByBulk

* refactor: allow nids for notifications.rescind

* refactor: allow uids array for user.updatePostCount

* refactor: rewrite deleteFromTopicUserNotification to work with an array

* feat: deprecate action:post.purge as well

* lint: add missing comma
2022-04-07 14:06:25 -04: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
Barış Soner Uşaklı
5143ca33f3 feat: handle array of keys in psql exists for zsets 2022-02-07 17:54:51 -05: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ı
9883910857 fix: don't crash if requestedFields is undefined 2022-02-03 09:48:14 -05:00
Barış Soner Uşaklı
07232a8cf6 fix: retry incrObjtFieldBy 2021-12-23 11:28:48 -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ı
0414356cf7 perf: don't load all set members to get count 2021-11-29 19:29:18 -05:00
Barış Soner Uşaklı
fb363957d1 refactor: tab rules 2021-11-18 16:42:18 -05:00
Barış Soner Uşaklı
8379c11b22 refactor: setObjectBulk to match sortedSetAddBulk 2021-11-12 19:51:59 -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ı
ea04aeded4 perf: convert promise.all to single query (#9851) 2021-10-01 15:24:19 -04:00
Barış Soner Uşaklı
07adb49e7f feat: mongodb driver 4.x (#9832)
* feat: mongodb driver 4.x

* feat: up dbsearach
2021-09-23 16:49:56 -04:00
Barış Soner Uşaklı
30f387710c fix: #9822, use correct username/pwd 2021-09-22 09:16:08 -04:00
Barış Soner Uşaklı
397835a05a feat: allow removing multiple items from list 2021-09-09 22:25:17 -04:00
Barış Soner Uşaklı
0ce4b87d85 fix: #9781 (#9782) 2021-09-03 20:34:42 -04:00
SAES:RPG
dd15065706 Fix [MONGODB DRIVER] Warning: bulk operation remove has been deprecated, please use delete (#9746)
Co-authored-by: Brophy <paul.brophy@bastage.net>
2021-08-26 09:44:16 -04:00
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
2021-08-21 23:31:31 -04:00
Barış Soner Uşaklı
6c47a060c1 fix: #9668, add raw info to psql database page 2021-07-20 20:36:44 -04:00
Barış Soner Uşaklı
3fb7444580 fix: returnOriginal deprecation
https://github.com/mongodb/node-mongodb-native/pull/2808
2021-05-28 11:12:21 -04:00
Barış Soner Uşaklı
94c12e3771 feat: #9508, add cluster support 2021-05-14 10:56:03 -04:00
Barış Soner Uşaklı
a3d6c56ec3 feat: #9551 2021-05-13 12:16:53 -04:00
Peter Jaszkowiak
dd81dd03e0 fix(#9508): switch to ioredis (#9545)
* switch to ioredis

also need this fix in redisearch:

redis-search.js:98
```
  redisClient.multi(cmds).exec(function(err, ids) {
    if (err) {
      return callback(err);
    }
    var errRes = ids[resultIndex];
    if (errRes[0]) {
      return callback(errRes[0]);
    }
    callback(null, errRes[1]);
  });
```

* dbsearch compatible with ioredis

* fixed dbsearch?
2021-05-11 14:18:45 -04:00
Barış Soner Uşaklı
2c22b06feb fix: isObjectField(s) empty field 2021-05-06 12:44:01 -04:00
Barış Soner Uşaklı
4e490f6058 test: fix redis tests 2021-04-22 11:28:10 -04:00
Barış Soner Uşaklı
92de49be00 test: add test for undefined fields in getObjectsFields 2021-04-22 11:14:47 -04:00
Barış Soner Uşaklı
4327a09d76 feat: allow optional fields argument on db.getObject(s) (#9385) 2021-03-14 11:40:54 -04:00
Barış Soner Uşaklı
3c60ccfd4d feat: upgrade connect-mongo, closes https://github.com/NodeBB/NodeBB/pull/9367 2021-03-11 13:44:14 -05:00
Peter Jaszkowiak
b9fd2c87f3 chore: bump deps (#9335)
* chore: bump deps

* fix: husky git hooks
2021-02-28 17:54:56 -05:00
Barış Soner Uşaklı
cdf5d18f54 fix: don't publish before pubClient is connected 2021-02-26 08:17:45 -05:00
Barış Soner Uşaklı
5286f20862 refactor: remove dupe code 2021-02-16 22:10:26 -05:00
Barış Soner Uşaklı
8f0386d9ac feat: add failing test for list append/prepend with list (#9303)
* feat: add failing test for list append/prepend with list

* feat: mongo/psql

* feat: improve test
2021-02-14 11:12:56 -05:00
Peter Jaszkowiak
cc9d6fd08b chore: eslint max-len 2021-02-08 18:06:44 -05:00
Peter Jaszkowiak
5c2f0f0557 chore: eslint no-restricted-syntax 2021-02-08 18:06:44 -05:00
Peter Jaszkowiak
115d19e289 chore: eslint prefer-rest-params, prefer-spread 2021-02-08 18:06:44 -05:00
Peter Jaszkowiak
23f212a4c0 chore: eslint prefer-destructuring 2021-02-08 18:06:44 -05:00
Peter Jaszkowiak
8d1462ffd8 chore: eslint object-curly-newline 2021-02-08 18:06:44 -05:00
Peter Jaszkowiak
62869bae3d chore: eslint function-paren-newline 2021-02-08 18:06:44 -05: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
Peter Jaszkowiak
4ee0f1459d chore: eslint import/newline-after-import 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ı
5bc1f5b4e8 fix: #9231, fix redis pubsub connection
regression from fdfbc90255
2021-01-31 12:37:28 -05:00
Barış Soner Uşaklı
78896fc623 fix: redis check compat tests 2021-01-23 00:04:48 -05:00
Barış Soner Uşaklı
fdfbc90255 feat: async/await redis connection 2021-01-22 23:59:52 -05:00