Commit Graph

271 Commits

Author SHA1 Message Date
Peter Bhat Harkins 4fd296e508 finish /u redirect from 9fff6ae9 with 301s 2024-01-02 10:45:00 -06:00
Peter Bhat Harkins 2332d28022 bump gems except commonmarker (#1234)
lot of irritating churn out of standardrb here
2023-12-28 19:26:56 -06:00
Tiago Ilieve a5a41e11f1 Show merged stories on duplicate submission 2023-12-27 08:27:33 -06:00
Peter Bhat Harkins 1caa4757d0 Rails 7.1 2023-12-23 22:41:35 -06:00
Peter Bhat Harkins cdde144b0d spec update for previous 2023-12-17 21:09:51 -06:00
Peter Bhat Harkins b45d175083 add brakeman
Wrote ignore notes and specs for the security assumptions implied.
Removed TZ from moderations table; everything is Chicago time, best time.
2023-12-17 20:22:47 -06:00
Peter Bhat Harkins e77495999e specs for previous 2023-12-13 12:12:29 -06:00
Micah Magruder 348d754428 Add rfc-editor info links to spec test 2023-12-01 16:51:06 -05:00
Micah Magruder 3327c4be9b Normalize rfc-editor.org links 2023-12-01 16:39:51 -05:00
Peter Bhat Harkins 8722f4229c missing migration in schema; standardrb generated file 2023-11-22 11:17:57 -06:00
Peter Bhat Harkins 3d4b2c2b2d fix #1224 email reply to whom 2023-11-22 11:08:08 -06:00
Peter Bhat Harkins 11bad8f847
Merge pull request #1204 from thiagofportella/master
Display unsave link for previously saved stories
2023-11-01 10:34:13 -05:00
thiagofportella 36bf8c38b7
test: create new memoized helpers for validation of save and unsave links in deleted stories 2023-10-09 11:22:07 -03:00
Peter Bhat Harkins d13c6c4676 comments: fewer db round trips on creation
Writes a vote directly to avoid vote_thusly doing round trips to check if one
exists, etc.

Removes redundant transactions from controllers from #899. Rails already creates
a transaction for the .save.

Unifies Story cache updating. Previously recalculate_hotness! was called twice
on comment creation. Moves comment counting into the db.

Shorter transaction should reduce the frequence of
lobsters/lobsters-ansible/issues/39 but seems unlikely to eliminate it as the
create + upvote transactions for stories + comments still read/write from
stories, comments, and votes.
2023-10-06 23:32:31 -05:00
Peter Bhat Harkins 8f65acd2dd add super_diff for better test output 2023-10-04 08:31:39 -05:00
Peter Bhat Harkins 5338e5a4b3 ignore garbage searches from searx 2023-10-02 09:05:22 -05:00
Peter Bhat Harkins 4184d1e053 search: prevent potential sql injection 2023-10-01 17:56:39 -05:00
Peter Bhat Harkins 26f5a84cb4 sort deleted comments to bottom 2023-09-27 11:08:37 -05:00
Peter Bhat Harkins 734476b73d bare searching for username; missing commenter explanation 2023-09-26 21:29:04 -05:00
Peter Bhat Harkins 7d2dd9d347 search by commenter 2023-09-25 10:02:07 -05:00
Peter Bhat Harkins c46ec5b84c search by story submitter 2023-09-25 09:10:16 -05:00
Peter Bhat Harkins 81a36c837d search: operator for title searching 2023-09-23 15:42:09 -05:00
Peter Bhat Harkins 60837ba071 search: fix searching domains with numbers 2023-09-23 13:51:28 -05:00
Peter Bhat Harkins b767d9d6a9 add sidekiq 2023-09-18 16:00:53 -05:00
Peter Bhat Harkins 5647897a76 search urls 2023-09-16 09:25:22 -05:00
Peter Bhat Harkins 1f32209b58 fix short hyphenated terms in prod searches
We truncated to have leading or trailing punctuation, confusing mariadb's parser
about operator usage. 'foo-bar' is ok, but 'foo-' and '-bar' are not. After
testing, mariadb splits terms at '-' anywways.

Dropped the explicit allowal of '_' because it's included in \p{Word}.
2023-09-16 08:03:08 -05:00
Peter Bhat Harkins 2e1bed2f58 search: be helpful about ignored short terms, which includes language names 2023-09-15 22:31:22 -05:00
thiagofportella d23e8d799f
feat: display unsave link for previously saved stories 2023-09-14 15:15:52 -03:00
Peter Bhat Harkins f467d5e943 fix for searches with two apostrophes 2023-09-14 09:38:08 -05:00
Peter Bhat Harkins 237e219116 standardrb: add standard-sorbet 2023-09-14 08:45:21 -05:00
Peter Bhat Harkins c2935af068 remove last vestiges of rubocop 2023-09-14 08:45:21 -05:00
Peter Bhat Harkins b159b661d5 fix spec from c2831121 2023-09-13 23:23:07 -05:00
Peter Bhat Harkins d11b222a50 parse search queries 2023-09-13 10:24:05 -05:00
Peter Bhat Harkins c3f8625788 standardrb
I can't take Rubocop any more. Moving up to Ruby 3 forces us to update RuboCop,
and it comes with dozens of linters that I'd have to evaluate, none of which is
a marginal improvement. I'm done having opinions.
2023-09-08 15:39:50 -05:00
Peter Bhat Harkins 8d10502488 rate-limit responses by flags 2023-09-02 13:21:56 -05:00
Peter Bhat Harkins 7f82650795 show merged stories on newest_by_user, deleted to submitter 2023-08-30 17:47:41 -05:00
Peter Bhat Harkins 7298381360 don't log changes to normalized_url 2023-08-30 11:10:59 -05:00
Peter Bhat Harkins 510fd3cc47 fill in id part of confidence_order immediately on create
Fix #1195
2023-08-29 22:39:25 -05:00
Peter Bhat Harkins 9fff6ae927 enable mod_userdir
diff of `rails routes`:

12,13d11
<                              GET      /newest/:user(.:format)                        home#newest_by_user
<                              GET      /newest/:user/page/:page(.:format)             home#newest_by_user
32d29
<                 user_threads GET      /threads/:user(.:format)                       comments#user_threads
120,122c117,132
<                            u GET      /u(.:format)                                   users#tree
<                         user GET      /u/:username(.:format)                         users#show
<                user_standing GET      /u/:username/standing(.:format)                users#standing
---
>                   users_tree GET      /users(.:format)                               users#tree
>                         user GET      /~:username(.:format)                          users#show
>                user_standing GET      /~:username/standing(.:format)                 users#standing
>                              GET      /~:user/stories(/page/:page)(.:format)         home#newest_by_user
>                 user_threads GET      /~:user/threads(.:format)                      comments#user_threads
>                     user_ban POST     /~:username/ban(.:format)                      users#ban
>                   user_unban POST     /~:username/unban(.:format)                    users#unban
>          user_disable_invite POST     /~:username/disable_invitation(.:format)       users#disable_invitation
>           user_enable_invite POST     /~:username/enable_invitation(.:format)        users#enable_invitation
>                            u GET      /u(.:format)                                   redirect(302, /users)
>                              GET      /u/:username(.:format)                         redirect(302, /~%{username})
>                              GET      /@:username(.:format)                          redirect(302, /~%{username})
>                              GET      /u/:username/standing(.:format)                redirect(302, ~%{username}/standing)
>                              GET      /newest/:user(.:format)                        redirect(302, ~%{user}/stories)
>                              GET      /newest/:user(/page/:page)(.:format)           redirect(302, ~%{user}/stories/page/%{page})
>                              GET      /threads/:user(.:format)                       redirect(302, ~%{user}/threads)
125,128d134
<                     user_ban POST     /users/:username/ban(.:format)                 users#ban
<                   user_unban POST     /users/:username/unban(.:format)               users#unban
<          user_disable_invite POST     /users/:username/disable_invitation(.:format)  users#disable_invitation
<           user_enable_invite POST     /users/:username/enable_invitation(.:format)   users#enable_invitation
2023-08-29 07:49:02 -05:00
Peter Bhat Harkins 42d3ad4c30 find similar_stories by normalizing, not regexping
Big performance win to drop a query that regexps every URL in stories (400-650ms
in prod).

Fix #931
Relates to #932
2023-08-28 17:35:11 -05:00
Peter Bhat Harkins a175e4b111 test bitpacking fundamentals for recursive cte 2023-08-24 03:13:30 -05:00
Peter Bhat Harkins 9c7f7d751c start for normalizing urls to similar_stories 2023-08-24 03:13:30 -05:00
Peter Bhat Harkins fabc8381de quick fix to #1174 to prevent 500s 2023-07-27 08:53:08 -05:00
Patryk f3ab19ee1c
Add youtube duplicate detection (#1174) 2023-04-26 08:21:05 -05:00
Peter Bhat Harkins 30295c028a lint, test for previous 2022-11-08 23:38:27 -06:00
tassja d352908c63 rename: repo variable to isolate use to single test 2022-11-07 16:35:52 +01:00
tassja 37b2ff6bf0 test: ensure stories are hidden in active tab 2022-11-07 16:26:57 +01:00
Peter Bhat Harkins b731305b94 tweak new domain controller - copy, var names, spec 2022-09-01 07:45:18 -05:00
Fat Shinobi f10529e727
Domains: web editing, transparency in tracker banning (#1119) 2022-08-31 13:23:33 +00:00
Pip f15bf560fe
Add tests for /filters page (#1122) 2022-08-24 13:31:21 +00:00