Commit Graph

123 Commits

Author SHA1 Message Date
Barış Soner Uşaklı
16504bad81 fix: sql injection in sortedSetScan 2025-05-12 10:02:59 -04:00
Barış Soner Uşaklı
e722e86956 refactor: get rid of async.parallel 2025-03-24 10:22:27 -04:00
Barış Soner Uşaklı
c60cee5997 fix: #13007, replace $ with \uFF04, like . 2024-12-24 12:37:06 -05:00
Barış Soner Uşaklı
c69fa811e5 fix: convert to str than filter
prevent empty strings from getting passed to mongodb
https://github.com/NodeBB/NodeBB/issues/13007#issuecomment-2560503754
2024-12-23 20:29:42 -05:00
Barış Soner Uşaklı
1b283ccc29 test: return empty array on db.exists([]); 2024-06-07 21:44:57 -04:00
Barış Soner Uşaklı
70b4a0e2ae feat: allow passing min,max to sortedSetsCardSum
to get rid of multiple db calls in profile page
2024-06-07 19:14:13 -04:00
Barış Soner Uşaklı
4e51bf81bb test: better test for #12352 2024-02-21 11:38:07 -05:00
Barış Soner Uşaklı
4a405ce032 fix: retry setAdd on e11000 error 2024-02-21 11:36:04 -05:00
Barış Soner Uşaklı
66be9826a2 test: add reverse list test 2023-10-03 12:50:20 -04:00
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ı
04998908ba Fixes for "validate email" & "send validation email" in ACP (#11677)
* confirmObj changes

dont expire confirm:<code>, add a expires field instead
dont expire confirm:byUid:<uid>

on admin manage users display the users email status
	1. verified
	2. verify email sent (pending)
	3. verify email sent (expired)
	4. no email entered

fix validate email in acp to use
	email in user:<uid> if they have one
	if not check if its in confirm:<code>
	if its not in above cant validate throw error

fix send validate email to use
	email in user:<uid> if they have one
	if not check if its in confirm:<code>
	if its not in above too cant validate throw error

* add back socket.io tests

* test: fix confirm tests

no longer using pexpire
return correct time left on token

* chore: update openapi

* fix: delete call

* test: mget test fixes

* test: fix tests
2023-06-05 12:12:48 -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
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
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ı
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ı
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
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
Barış Soner Uşaklı
2c22b06feb fix: isObjectField(s) empty field 2021-05-06 12:44:01 -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ı
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
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ı
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ı
0d7dfeeb86 chore: increase test timeout 2021-01-04 17:09:14 -05:00
Barış Soner Uşaklı
7f5efc3e93 fix: #8992, set email:confirmed for first admin user 2020-11-28 14:43:28 -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
Barış Soner Uşaklı
b2ff1594b8 fix: redis hget
'node_redis: The HGET command contains a invalid argument type.\n' +
'Only strings, dates and buffers are accepted. Please update your code to use valid argument types.'
2020-10-15 22:25:56 -04:00
Timothy Fike
5078a8df25 ttl/pttl (#8689) 2020-09-27 22:10:46 -04:00
Barış Soner Uşaklı
9389749b79 feat: sorted set lex test 2020-09-11 21:12:49 -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ı
bef37e27cb fix: test lock for user create (#8415)
* fix: test lock for user create

* fix: redis hdel with undefined

* feat: add test for undefined key in deleteObjectFields
2020-06-18 23:16:48 -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ı
7a801abade fix: tests on redis 2020-05-16 22:49:34 -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