Commit Graph

1329 Commits

Author SHA1 Message Date
Earlopain
be71bf7a16
[Elasticsearch] Move implementation to own folder 2023-09-16 14:29:04 +02:00
Earlopain
3285d546f9
[Elasticsearch] Move index creation to DocumentStore 2023-09-14 21:53:26 +02:00
Earlopain
855388b092
[Elasticsearch] Remove a few more easy usages of __elasticsearch__ 2023-09-14 20:56:56 +02:00
Earlopain
a79e25dfbd
[Elasticsearch] Start implementing own elasticsearch-model
This implements create_index!
2023-09-14 20:49:19 +02:00
Earlopain
c53b2eff60
[Tests] More performance improvements
Most of the gained time is because some post tests don't recreate the
elastic index twice now.
Tests go from 107 seconds to 95 on my machine.
2023-09-08 19:51:35 +02:00
Earlopain
4c6f4fe104
[CI] Appease rubocop 2023-09-07 17:32:50 +02:00
Earlopain
d5b64b1712
[Tests] Improve execution time of some of the worst offenders
From 112 seconds to 107 on my machine
Not much all things considered but most of the time is still spend on
elasticsearch, especially when forcefully recreating the index
2023-09-07 17:04:34 +02:00
Donovan Daniels
115c140cc2
[Posts] Make comment_disabled not hide comments (#546)
* [Posts] Make comment_disabled not hide comments

* [VoteManager] Disallow voting on locked/disabled comments

* [Comments] Disable editing/hiding disabled & locked comments

* Tweaking

* Allow hiding when comments locked
* Don't allow mods to vote when comments locked
* Change wording from disabled to locked everywhere

---------

Co-authored-by: Earlopain <14981592+Earlopain@users.noreply.github.com>
2023-09-05 17:27:05 +02:00
Earlopain
c51029ea1e
[ModActions] Stop logging name changes
These are not mod actions, anybody can do that. Only log when admins
force change names.
Don't show old/new names, we already don't show that on user profiles.
2023-09-04 23:02:14 +02:00
Earlopain
177558b5d5
[TagQuery] Use consistent naming for tag fields 2023-09-03 15:23:27 +02:00
Earlopain
b2c7b338c0
[TagQuery] Improve description search
These all works:
* description:test
* description:"multiple words followed by each other"
* description:"multiple words followed by each oth*"
2023-09-03 15:12:40 +02:00
Earlopain
be75cf3349
[QueryBuilder] Fix searching by tag counts 2023-08-31 08:57:47 +02:00
Earlopain
8b133570c0
Merge pull request #543 from e621ng/search-improvements
Search improvements
2023-08-29 18:54:42 +02:00
Earlopain
b65741456f
[QueryBuilder] Move count validation into the query class 2023-08-24 13:43:01 +02:00
Earlopain
c8d7bebd72
[QueryBuilder] Move parsing code into own class
Introduces the concept of "free" tags to account for automatically added tags.
Introduce `resolve_aliases` which can be used instead of `raw_tag_match`
2023-08-24 13:16:44 +02:00
Earlopain
9848c18ace
[QueryBuilder] Move value parsing into separate module
Also add some tests
2023-08-23 14:18:51 +02:00
Earlopain
1621e6e110
[QueryBuilder] Rename range parsing methods for clarity
Also replace a bit of the regex matching with more explicit code.
2023-08-22 23:23:08 +02:00
Earlopain
b7b9a8c400
[Users] Remove the contributor rank
We don't use that anymore. Next one up is former staff, so the checks
look a bit goofy now.
2023-08-21 21:24:31 +02:00
Earlopain
f193e159eb
[QueryBuilder] Introduce methods to handle common search actions 2023-08-19 18:37:15 +02:00
Earlopain
d579c845f3
[Cleanup] Remove duplicate tag query scan method 2023-08-19 11:20:00 +02:00
Earlopain
b4a7a5ba3d
[Cleanup] Remove unused tag methods 2023-08-18 23:08:42 +02:00
Earlopain
c9a084e0a3
[Tags] Take category id instead of name for related search
Also have the bulk response return something with more structure to it
2023-08-18 22:40:06 +02:00
Earlopain
36eb87b084
[Cleanup] Move tag data outside of config file
Most of that is not easily configurable and requires db fields, css classes etc.
Everything in TagCategory was also pretty much incomprehensible for me
thanks to the indirection, so I moved it all inline instead.
I'll clean that up in later commits.
2023-08-18 19:08:52 +02:00
Earlopain
3aecc36b3e
[Users] Fix exception when refreshing counts 2023-08-15 14:13:58 +02:00
Earlopain
d6bfa02694
[Replacements] Fix approving when hitting the upload limit
Also improves the error message that was being returned because
just saying 'pending' isn't really helpful
2023-08-11 17:39:33 +02:00
Earlopain
3f03182dfb
[Cleanup] Remove a test-only method 2023-08-11 17:30:43 +02:00
Earlopain
e6d3fabc2a
[Posts] Don't unflag if approving on the show page
My previous commit on the matter says that this was intented behaviour
and always like that but it's just unexpected
2023-08-07 20:23:13 +02:00
Earlopain
2ce42c49e3
[Users] Add replacements to the hourly upload limit 2023-08-05 12:29:38 +02:00
Earlopain
42abd4ca33
[UserRevert] Fix error when user has uploaded a post
Extended version of #530

Co-authored-by: Donovan Daniels <hewwo@yiff.rocks>
2023-08-01 18:20:39 +02:00
Earlopain
52bc715a28
[Posts] Add edit reason when reverting/undoing a version 2023-08-01 17:24:14 +02:00
Earlopain
66c66af58c
[Users] Fix switching names not updating the cache correctly
Regressed in7df64409d6
update_cache was not updated to normalize the username
2023-07-31 23:14:39 +02:00
Earlopain
12e996dc08
[Tags] Fix category for non-existant tags
Regressed in 4cd32c5f87
Caching nil as a category can cause problems in a bunch of places
2023-07-31 21:36:20 +02:00
Earlopain
eb7033dbc2
[Artists] Fix reverting removing urls when validations fail 2023-06-18 16:13:08 +02:00
faucet
cbe809fed5
[Tags] Disallow é in tag names 2023-06-10 17:46:04 +01:00
Earlopain
33bab9e9f0
[Artists] Fix autocomplete
I removed the _like parameter in 40dd24f387 but missed this usage
2023-06-05 17:04:47 +02:00
Earlopain
1c42ce1464
[Cleanup] Use a consistent method signature for search
The name parameter for the user search is unused.
2023-06-02 16:15:17 +02:00
Earlopain
300866fe94
[Dmails] Add option to not send email notifications 2023-06-02 16:04:49 +02:00
Earlopain
40dd24f387
[Cleanup] Remove search_text_attribute
* Undocumented
* Some don't work because of strong params

Some of the possible attributes seem like they would be
useful but I would rather introduce them properly and
with more thought behind it
2023-06-01 21:45:51 +02:00
Earlopain
9035f845ee
[Search] Fix sequential prev/next buttons
Apparently this broke with the upgrade to rails 7, see cae6599631
The overwritten records method is at fault.
Added some tests to confirm that both elastic and active record
return the correct result to prevent breakage in the future.
2023-05-29 20:12:14 +02:00
Earlopain
05b100f8da
[Cleanup] Remove Cache.hash
Rails already handles long keys for us
2023-05-19 22:14:34 +02:00
Earlopain
6841fe3b7e
[Cleanup] Remove dead code around post query counting 2023-05-19 20:43:59 +02:00
Earlopain
8fe5cb986b
[Tests] Add zeitwerk compliance check
Because I'm stupid
2023-05-01 17:30:13 +02:00
Earlopain
9ae9fa51c0
[Posts] Fix uploading of urls with square brackets
Mostly encountered on furaffinity.
Since this is now also a problem for iqdb I though why not try a fix
2023-04-24 21:24:48 +02:00
Earlopain
aef5840425
[Posts] Fix locked notice always showing on edit with dnp tags
Closes #462
2023-04-10 20:08:36 +02:00
Earlopain
aca5543f3c
[UserFeedback] Add option to send dmail on update 2023-04-10 12:51:03 +02:00
Earlopain
580776ca81
[Comments] Remove quoted response 2023-04-03 00:10:28 +02:00
Earlopain
18e809937f
[ModActions] Fix artist rename/unlink
Also removes the unsed wiki_page_undelete action
Part of #488
2023-03-23 20:14:17 +01:00
Earlopain
de3f7d6a6e
[Tests] Fix random failures
Sometimes the seconds tick over to the next one during execution,
resulting in failures. This should be the end of that.
2023-02-27 13:00:28 +01:00
Earlopain
49275af9b0
[Tests] Remove usage of rand
Makes them more deterministic
2023-02-26 14:58:08 +01:00
Earlopain
996f1c30c1
[Tests] Remove/Disable remaining failing tests 2023-02-25 00:15:08 +01:00
Earlopain
9d1d195fa2
[Cleanup] Remove a bunch of code around is_single_tag?
That method will never return true because status:deleted is getting appended.

Also remove a bunch of related_tags code.
It was either calculate_related_tags_from_post_set or related_tags_for_group.
The results from calculate_related_tags_from_post_set look good in every case,
I can't tell one over the other. This one should be more efficient, since
it doesn't have to do an extra post search.
2023-02-24 23:26:07 +01:00
Earlopain
02a4051031
[Tests] Be explitic about where jobs need to be inlined 2023-02-24 14:14:44 +01:00
Earlopain
5215876862
[DB] Remove usage of dedicated index columns
The index for posts is also getting added, but will get used at a later date
If this turns out to work fine the materialized index colums can be dropped

This contains a semantic change where dmail and wiki page searches for the body
no longer includes matches for the title
2023-02-19 20:01:54 +01:00
Earlopain
902e35673f
[Posts] Relax voting isolation level and remove lock
"The serialization of the vote and favorite actions was likely excessive
 even in the production configuration, and it has been relaxed to use
 repeatable_read in this implementation. The locks on rows were also
 removed as they do not have strict locking requirements with this transaction
 level to my knowledge."
2023-01-28 15:37:20 +01:00
Earlopain
690750d020
[Posts] Allow guidelines flag in more cases for priv+ 2023-01-27 22:25:48 +01:00
Earlopain
ead6d0919e
[PostFlags] Remove test reason 2023-01-26 21:44:00 +01:00
Earlopain
f6b53dd0d3
Merge branch 'moderator-role' 2023-01-11 17:05:37 +01:00
Earlopain
76f54e32b9
[BURs] Remove another unused import parameter
Was only possible to set to false on the previously removed import page.
2022-12-26 20:36:53 +01:00
Earlopain
e3b02a7f96
[BURs] Rename importer class 2022-12-26 20:21:33 +01:00
Earlopain
f08a094ea2
[BURs] Remove unused first parameter for import 2022-12-26 20:09:32 +01:00
Earlopain
b6f006a353
[Cleanup] Remove forum topic merging 2022-12-23 16:58:32 +01:00
Earlopain
e262f06a93
[Cleanup] Remove NoteSanizier
Notes are formatted using dtext only. Even though the existance of this
class suggests that some html elements are allowed, it doesn't actually do anything.
Link relativization also didn't work, same with dtext colors.
2022-12-17 17:00:27 +01:00
Earlopain
cb3d34b650
[Cleanup] Use the same method names for Cache as Rails 2022-11-29 19:14:09 +01:00
Earlopain
7a028cf003
[Tests] Set CurrentUser.ip_addr in base setup 2022-11-26 16:20:16 +01:00
Earlopain
c68fdfce2b
[Tests] Always use CurrentUser as helper 2022-11-26 15:20:15 +01:00
Earlopain
20ef412b68
[Cleanup] Remove CurrentUser.root_url 2022-11-26 14:43:43 +01:00
Earlopain
98e55562eb
[Tests] Clean up teardowns 2022-11-26 14:02:06 +01:00
Earlopain
918a3f491d
[Tests] Remove useless travel_to 2022-11-26 13:52:37 +01:00
Earlopain
e0819dfd5f
[Tests] Remove as_admin helper 2022-11-26 12:37:22 +01:00
Earlopain
87313c437c [Tests] Include FactoryBot::Syntax::Methods
The newly included create method behaves exacly like the self-written one,
with the added benefit of it not appearing in backtraces.
2022-11-25 21:06:54 +01:00
Earlopain
b690177f07 [Tests] Remove useless stub 2022-11-25 20:09:24 +01:00
Earlopain
00c1dc27e1
[Tests] Use file_fixture/fixture_file_upload 2022-11-25 18:44:36 +01:00
Earlopain
04b18d0852
[Tests] Disallow and stub all requests being made
Make CloudflareService a module for easier stubbing
2022-11-25 17:27:38 +01:00
Earlopain
c9f65608de
[Tests] Replace timecop with native Rails method
Also removes it at a bunch of places where it's not needed
2022-11-25 14:32:56 +01:00
Earlopain
6214cbd16e
[Cleanup] Remove more pool post set code 2022-10-19 18:15:00 +02:00
Earlopain
27371dfc84
Merge pull request #440 from zwagoth/votes
Votes
2022-10-13 21:44:03 +02:00
Earlopain
c2adf1bf31
[Users] Reset account level on deletion 2022-10-13 18:37:52 +02:00
Earlopain
e7b155cb85
[Cleanup] Remove where_regex
Only artist_url matching was using this.
2022-10-13 18:22:07 +02:00
Earlopain
696ae62ef6
[Votes] Deduplicate Comment/Post vote code 2022-10-08 12:04:17 +02:00
Earlopain
33dba98cf5
[Cleanup] Simplify/Remove some post set code 2022-09-30 14:23:54 +02:00
Earlopain
999e410665
[Tests] A bunch of fixes, again 2022-10-01 19:11:46 +02:00
Earlopain
8a6fb57cc2
[Tests] Remove note_count 2022-10-01 19:11:40 +02:00
Earlopain
6801742487
[Cleanup] Remove promote message code 2022-09-26 20:20:20 +02:00
Earlopain
3fe4b718cc
[Posts] Prevent adding specific tags when base tag is locked
Closes #399
2022-09-24 20:43:49 +02:00
Earlopain
9089290eb5
[Tests] Fix not reloading post to update is_flagged 2022-09-24 20:43:48 +02:00
Kira
fb1fb87047 [Posts] When approving your own uploads, don't increment approval count
This brings the behavior of approvals on your own uploads in line with uploading
with the automatic approvals enabled.
2022-09-20 02:13:00 -07:00
Kira
d56334ea4c [Posts] Prevent automatic flag removal when approving posts
In order to prevent mistakes where posts are approved from the index page
flags are no longer automatically resolved on approval.

This does not modify the approval behavior of clearing flags from the post
page itself, where the action is explicitly performed by jan+.
2022-09-20 02:08:45 -07:00
Earlopain
e1e9324c84
[Tests] A few fixes 2022-09-17 19:32:21 +02:00
Earlopain
34bece584c
[Posts] Simplify tag list generation
There were a bunch of parameters being passed around, now there aren't.
Also gave the methods more descriptive names.
2022-09-17 13:18:33 +02:00
Earlopain
94e3dac343
[TagAliases] Don't change category of the target tag when non-general on approve 2022-09-16 19:22:28 +02:00
Earlopain
0cd5391d3c
[Users] Fix double dot in account to new message 2022-09-11 18:54:43 +02:00
Earlopain
b78d55fdd3
[Posts] Add new flag reason for pending posts 2022-08-20 18:19:08 +02:00
Earlopain
0a03bea16c
Merge branch 'master' into pools-is-deleted 2022-08-07 16:29:47 +02:00
Earlopain
4cb88300c7
[Versions] Rename post/pool archive classes to versions
This just makes sense, and was confusing beforehand.
Case-in-point: Two test classes for pools: pool_versions and pool_archive
2022-08-06 18:58:24 +02:00
Earlopain
7e33ea8271
[Cleanup] Remove pool is_deleted
Pools are hard-deleted now. There are also a few pools with this flag
which can't be properly deleted at the moment
2022-07-11 22:52:26 +02:00
Earlopain
7531fc9894
[Cleanup] Remove an assortment of unused code 2022-07-11 20:17:24 +02:00
Earlopain
2b8173e05a
[Tests] Small amount of fixes 2022-05-26 22:49:43 +02:00
Earlopain
10cc7e7dba
[Cleanup] Remove iqdb test helper 2022-05-26 19:35:46 +02:00
Earlopain
3b714dd726
[EmailBlacklist] Only unverify exact domain matches 2022-05-23 08:10:54 +02:00
Earlopain
b2a733d0c4
[Replacements] Fix duration when replacing gif -> webm 2022-05-22 21:39:21 +02:00