Commit Graph

1698 Commits

Author SHA1 Message Date
Earlopain
1da52e3d0d
[TagRelations] Fix rejecting in certain cases
Rejection should always be possible
Previously this skipped validations, now it doesn't
2024-03-03 20:35:28 +01:00
Earlopain
853790272b
[Posts] Allow excluding multiple ids in search 2024-03-03 20:04:02 +01:00
Earlopain
17b99821e3
[Posts] Fix searches for huge ids erroring
This is because they can exceed Integer.MAX_VALUE on the opensearch side
2024-02-28 17:25:54 +01:00
Earlopain
7c03dddc56
[Pools] Fix exception on the ordering page
Broken through 0381653e80
2024-02-27 18:37:22 +01:00
Earlopain
45fd9d52a8
[RuboCop] Disallow logging in tests
Don't want these committed
2024-02-27 16:18:01 +01:00
Earlopain
2d7e507555
[Posts] Show an icon for non-matches urls 2024-02-27 15:48:52 +01:00
Earlopain
a816ee3b34
[BURs] Don't use tag_string_diff for tag nuking
This doesn't have the same issue as mass updates, but
it doesn't hurt to change this away from tag_string_diff as well

Aliases/Implications still do this but considering this has been the case
for 4 years now I don't believe this to be a problem
2024-02-26 16:56:20 +01:00
Earlopain
ca56ef3529
[BURs] Fix mass updates when the tag has been aliased away
Resolving aliases here is not great. Just mass update nothing in these cases, that's much safer.

Using tag_string_diff also wasn't a very bright idea, this too can result in both tags being removed
2024-02-26 16:48:25 +01:00
Earlopain
e0b52c13af
[PostVersions] Fix display of unchanged locked tags
2352bf54f6 (r139054663)
2024-02-26 12:48:58 +01:00
Cinder
e1e4b94a50
[Misc] External link favicons (now without a spritesheet) (#610)
* [Misc] Add favicons to some external links

* RuboCop changes from master

* Use packs for favicon images

This works better with caching.
If the file changes, the url changes

* Add favicons to an artists domain list

* Fix aliases

The lookup is done by strings, the keys were symbols

* Add old deviantart cdn alias

* Guard against links with that parse down to no host

http:twitter.com for example

* Tweak flow

* Add basic tests, fix some of what I probably broke

---------

Co-authored-by: Earlopain <14981592+Earlopain@users.noreply.github.com>
2024-02-25 20:27:54 +01:00
Earlopain
fc7d84affd
[RuboCop] Enable Style/FrozenStringLiteralComment
This reduces allocations on the posts page by about 5%, from basic testing
2024-02-25 18:15:55 +01:00
Earlopain
930b4b905c
[Pools] Fix show/gallery for frozen string literals
Get rid of the presenters/post sets.
2024-02-25 11:38:55 +01:00
Earlopain
6c623496a2
[Users] Stop using has_mail bitflag 2024-02-23 17:18:22 +01:00
Donovan Daniels
6b2b2cfc14
[DMails] Add marking as unread (#620)
* [DMails] Add marking as unread

* Tweak wording to be same as "Mark all as read", dmail capitalization
2024-02-23 16:39:59 +01:00
Earlopain
f59399ed67
[TagRelationships] Fix aliases/implications being left in queued state
This wasn't going through the error handler
2024-02-22 17:38:51 +01:00
Earlopain
9f796049a3
[Tests] Remove a rails bug workaround
Fixed sometime in the last 5 years
2024-02-22 16:44:19 +01:00
Earlopain
069a009dde
[Cleanup] Refactor help pages
The code wasn't very easy to follow. Uses the hip new normalized method from Rails 7.1
Adds some barebones tests
2024-02-15 20:05:36 +01:00
Earlopain
43ade626e0
[AIBUR] Fix ModActions for implications and on alias reject 2024-02-15 16:58:47 +01:00
Earlopain
860084b68c
[Tests] Skip more flakiness
https://github.com/e621ng/e621ng/actions/runs/7905570941/job/21578501986
2024-02-14 19:23:10 +01:00
Earlopain
8112e57329
[Tests] Skip flaky pagination test on CI 2024-02-04 16:51:13 +01:00
Earlopain
b00f7145c0
[Rails] Enable some new framework defaults
Others require a deploy first (like caching stuff) or need more thought (like serialization changes)
2024-01-27 13:49:57 +01:00
Earlopain
0fad5d5659
[Comments] Fix exception when searching by poster_id
Caused by 2c832dc633
poster_id requires a join and these columns weren't fully qualified.
2024-01-25 18:47:26 +01:00
Donovan Daniels
8f8feac8aa
[Artists] Show error when changing notes with locked wiki page (#580)
* [Artists] Show error when changing notes with locked wiki page

* [Tests] Add tests for editing artists with locked wiki pages
2024-01-14 21:01:01 +01:00
Earlopain
1fed677a45
[Tickets] Make response mandatory 2024-01-14 12:36:37 +01:00
Donovan Daniels
c11ad6b874
[UserFeedback] Add Updater 2024-01-04 14:31:54 -06:00
Earlopain
acae76a907
[Dmails] Change http verb from post to put for marking as read
That's what mark_all_as_read should have been from the start and
what I should have put mark_as_read to as well
2023-12-18 20:03:38 +01:00
Earlopain
18f8f99730
[Dmails] Don't mark as read on show for API requests 2023-12-17 20:08:44 +01:00
Earlopain
f477141c63
[Dmails] Add route to mark single dmail read 2023-12-17 20:06:10 +01:00
Earlopain
16014a438f
[Dmails] Partially enable api
Basically everything except sending
2023-12-17 19:55:13 +01:00
Donovan Daniels
74007f2e30
[Blips] Add Updater & Tests/Move modactions to callbacks (#540)
* [Blips] Add `updater_id` & update notice

* [Blips] Move modaction generation logic into rails callbacks

* [Tests] Add blip tests

* Move update notice to right place

* Assert amount of difference

* Rebase oopsie

---------

Co-authored-by: Earlopain <14981592+Earlopain@users.noreply.github.com>
2023-12-04 20:56:14 +01:00
Donovan Daniels
6eaf435002
Bring ForumPost ModAction trigger in line with Comments (#542)
* [Tests] Add hide & delete modaction tests to comments and forum posts

* [ForumPosts] Remove user id check on destroy

* [ForumPosts] Don't create edit modaction on hide

* Assert correct amount of ModActions is created

Especially important when it previously created 2 instead of 1 for hiding

---------

Co-authored-by: Earlopain <14981592+Earlopain@users.noreply.github.com>
2023-12-04 19:41:29 +01:00
Donovan Daniels
10e9304f17
[ForumPosts] Check for existence of topic & category (#524)
* [ForumPosts] Check for existence of topic & category

* [Tests] Add invalid topic category_id test

* Tweak how it is getting validated

If the category doesn't exist there's not point in doing anything further

* Move response assert before the other one

Should always be that way. If the response doesn't have the expected format
the assert will for sure fail and produce a confusing error message

---------

Co-authored-by: Earlopain <14981592+Earlopain@users.noreply.github.com>
2023-12-04 18:03:11 +01:00
Earlopain
b68fcd8148
[Admin] Fix editing email validation 2023-12-03 15:53:33 +01:00
Earlopain
7dcaf81979
[Uploads] Don't follow redirects to non-whitelisted urls
Also improves the existing tests a bit by being checking the error message
2023-10-20 21:00:32 +02:00
Earlopain
cc6e18797a
[Uploads] Correctly follow redirects
Some sites serve urls that redirect by default. This would append the
"You are being redirected" html to the file being downloaded after that
and subsequently report that text/html is not a valid format
2023-10-15 13:52:38 +02:00
Earlopain
2620ea983e
[Wiki] Better diffing view 2023-10-15 13:08:28 +02:00
Earlopain
3a58ac0938
Switch to OpenSearch (#550)
Run the following commands to import data into OpenSearch:

Post.document_store.create_index!
PostVersion.document_store.create_index!
Post.document_store.import
PostVersion.document_store.import

* Add opensearch client

* Add url param to force use opensearch

* Switch import method over to opensearch

* Index to opensearch as well

* Add option to gradually roll out os

* Index os with separate queue

* Move os post creation to job as well

* Exclusively use the OpenSearch client

* Stop enqueuing OsIndexUpdateJob

* Remove remaining elasticsearch code

Bump faraday since v2 is no longer blocked
2023-10-02 18:57:07 +02:00
Earlopain
a0c56446fa
Merge pull request #548 from e621ng/remove-elasticsearch-model
Remove elasticsearch-model
2023-09-18 20:29:56 +02:00
Earlopain
632b611c4c
[Dmails] Fix senders copy being created when validations fail 2023-09-17 16:40:33 +02:00
Earlopain
9e2c7b2b5b
[Cleanup] Remove ban check when sending dmails
Banned users can't login in the first place
2023-09-17 14:38:43 +02:00
Earlopain
b6dc473a55
[Elasticsearch] Bring back the proxy object 2023-09-16 17:09:33 +02:00
Earlopain
b4e16fa0fd
[Elasticsearch] Implement Response 2023-09-16 15:30:28 +02:00
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
0f842b9da0
[Tests] Remove wasteful post after_create hook
Not needed anymore.
Tests went from 95 seconds to 82 on my machine.
2023-09-08 21:33:25 +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
de4068ade8
[Tests] Clear elasticsearch before tests run
Previously they were only created if they didn't exist.
Data from previous test runs was still present.
2023-09-08 19:17:47 +02:00
Earlopain
499d447352
[Users] Fix custom css
The constraint applies to all user routes, which includes `custom_style`.
Also fixes a constant redefinition warning in the console when doing `reload!`
2023-09-07 21:08:55 +02:00