Commit Graph

97 Commits

Author SHA1 Message Date
Donal McBreen c4498212dc Merge branch 'main' into sqlite
* main: (116 commits)
  Ensure avatar thumbnails are square
  Update useragent to recognize twitterbot/facebot
  Add defensive styles for non-square avatar images
  Update test for copy changes
  Missed commit
  AI: standardize on https://agents.md
  Make it clear this is just notifications, not comprehensive activity
  AI: configure MCP servers for Chrome, Grafana, and Sentry (#1727)
  Allow requests from Google Image Proxy
  Update to basecamp's useragent fork
  Clean up a little bit the CSRF reporting code
  Claude: production observability guidance (#1725)
  Prevent autoscroll to the root columns container to prevent jump on page load
  Include full name string so you can type your name to filter
  Prioritize current user and assigned users in assignment dropdown
  Check and report on Sec-Fetch-Site header for forgery protection
  bundle update
  Bump bootsnap from 1.18.6 to 1.19.0
  Bump rails from `077c3ad` to `17f6e00`
  Fix cards getting stuck in edit mode
  ...
2025-11-26 10:07:41 +00:00
Donal McBreen b571303385 Don't use Current.account for search records
It doesn't actually work, and even if we could make it work reliably
we are better off if the records always know to go to the right shard.

It does make the interface a bit more complicated as we need to select
the right shard class with `for(account_id)`.
2025-11-25 11:34:41 +00:00
Mike Dalessio e0aa1d257e Drop User.system and replace with Account#system_user 2025-11-24 13:23:57 -05:00
Donal McBreen 525e53a2f7 Add FTS ActiveRecord model
Needs some special handling for the FTS virtual table format. Set the
primary key to rowid and manually specify the columns.
2025-11-21 15:21:11 +00:00
Donal McBreen 01d16f96d4 Remove Search::Record.for_account
Instead we'll compute the table name dynamically based on
Current.account where needed. Also we'll prevent searchable records
from being saved if Current.account is not set, otherwise the after
commit callbacks will fail.
2025-11-21 12:09:21 +00:00
Mike Dalessio 1bbb6d0c03 Fix race condition in Card::ActivitySpike::DetectionJob
The check-then-act pattern in `register_activity_spike` has been
replaced with `find_or_create_by!` to eliminate the race condition
that could lead to creating multiple activity spikes for a card. To
support this change, the `card_id` index on `cards_activity_spikes`
has been made unique.

ref: https://app.fizzy.do/5986089/cards/3063
2025-11-20 15:40:42 -05:00
Mike Dalessio 88750a3498 Prefer Time.current to Time.now 2025-11-20 09:13:17 -05:00
Mike Dalessio dbbee2c661 Stalled cards are unstalled by anything that touches updated_at
ref: https://app.fizzy.do/5986089/cards/2492
2025-11-18 17:46:56 -05:00
Mike Dalessio 97a6916ae1 Update a card's created_at when it is published
ref: https://app.fizzy.do/5986089/cards/2854
2025-11-17 17:39:25 -05:00
Mike Dalessio 73812817e9 Improve card entropic test 2025-11-17 09:12:41 -05:00
Mike Dalessio 4976e4a7bb Update Card::Entropic so its scopes work cross-accounts
with an eye towards making the postpone_all_due recurring job work efficiently.
2025-11-17 09:12:41 -05:00
Donal McBreen 28efe28f24 Replace Search::Index with Search::Records
Lean on ActiveRecord models for searching and strip out the raw SQL.
Replaces the search_index_* tables with sharded search_records_* tables
as that allows us to use a Search::Record model name.

A Class is dynamically created for each record table shard so that we
and we can access it via the Search::Record.for_account(account_id)
method.
2025-11-17 09:12:40 -05:00
Kevin McConnell 59dd8ca549 Make IDs more time-sortable in tests
In order for model ordering to work as expected in tests, we need to
keep two properties:

- Fixtures are all created in the past
- Models sort in the order that they were created

This allows us to do things like this:

    post cards_path, params: { ... }
    created_card = Card.last

When using UUIDv7 PKs rather than sequential integers, we have to make
sure a couple of things happen in order for this still to be true:

- Fixtures should generate deterministic IDs that translate to UUIDs
  that would have been created in the past (i.e. before today)
- Newly created objects must have enough precision in their timestamps
  so that they sort in the order they were created, and their random
  component doesn't come into play.

To solve this, we use the deterministic numeric ID as a number of
milliseconds after an early year. And we ensure that the new timestamps
we create have sub-millisecond precision.
2025-11-17 09:12:40 -05:00
Mike Dalessio 6df681991f rubocop: fix style warnings 2025-11-17 09:12:36 -05:00
Kevin McConnell 1959e15f7e Fix more tests
These are mainly because the fixture's UUIDs are deterministic rather
than time-sortable, and more places where we need to correct the fixture
IDs as well.
2025-11-17 09:12:31 -05:00
Donal McBreen 3aa4a1a562 Shard the search index into 16 tables
Create search_index_0 to search_index_15 tables and shard each index by
account id. MySQL has no ability to pre-filter fulltext indexes by
another field so this is the best bet for improving performance.

Each fulltest index internally creates 11 sub tables (see
https://dev.mysql.com/doc/refman/8.4/en/innodb-fulltext-index.html) so
actually we have 192 tables in total here.

The search_index table name is generated dynamically based on the
account_id.
2025-11-17 09:12:17 -05:00
Donal McBreen 996140e053 Add non transactional search tests
MySQL fulltext indexes are only updated on commit. Use a single test in
each file to avoid repeated setup.
2025-11-17 09:12:17 -05:00
Mike Dalessio 7bd697f75e test: Skip search tests, fix others, and skip a few hard ones 2025-11-17 09:11:42 -05:00
Jorge Manrubia eea9afb639 Fix: dismiss grouped notifications by card from the notifications tray
This also splits the templates into two: index and tray, since the URL now changes.
2025-11-14 12:58:24 +01:00
Jorge Manrubia 0d55c966b3 Fix: setting board entropy was changing the account entropy when not present 2025-11-14 12:10:54 +01:00
Jorge Manrubia 956a7aafad Revert "Revert "Color a11y"" 2025-11-14 11:24:55 +01:00
Jorge Manrubia 6413570985 Revert "Color a11y" 2025-11-14 11:21:52 +01:00
Jorge Manrubia 06b762c0a8 Move default color to the column 2025-11-14 11:15:09 +01:00
Jorge Manrubia b1e087e7c9 Introduce a proper color poro to represent colors
Instead of managing a hash throgh the app
2025-11-14 11:09:39 +01:00
Andy Smith 2b0fd0909d Fix test 2025-11-13 17:32:36 -06:00
Jorge Manrubia 03a345609e Baseline replacing collection with board across code 2025-11-05 13:31:54 +01:00
Jorge Manrubia 9d4dd3b00e Remove "save as draft"
Removes the creating status completely as well as the abandoned cards system. It will
always resume drafts if they exist, for a given collection and user.

https://app.box-car.com/5986089/cards/2489
2025-11-03 09:32:29 +01:00
David Heinemeier Hansson b3474ec97d Rename Entropy::Configuration to just Entropy 2025-11-02 13:11:41 +01:00
Jason Zimdars a8fc78fa90 Update tests 2025-10-29 11:23:13 -05:00
Jorge Manrubia 85bee1af9b Add events for moving between columns 2025-10-29 14:49:02 +01:00
Stanko K.R. a67fd7b082 Add missing quotation mark 2025-10-23 12:50:41 +02:00
Stanko K.R. 2ac2d4e0da Add postpone and auto-postpone as Webhook triggers 2025-10-23 12:31:22 +02:00
Jason Zimdars 8ca9e80c6c Settle on "Moved to Done" 2025-10-17 16:56:26 -05:00
Jason Zimdars da413e7540 Remove closure reasons 2025-10-15 16:15:56 -05:00
Jorge Manrubia 0666e504d6 Assign postpone_by to system when auto-cleaning 2025-10-15 15:08:41 +02:00
Jorge Manrubia 9263cff3d5 Store and show the user that postpones cards 2025-10-15 13:44:49 +02:00
Jorge Manrubia 5e09944606 Separate card and collection watchers
https://fizzy.37signals.com/5986089/cards/375
2025-10-03 19:04:01 +02:00
Jorge Manrubia 1bb8de8564 Fix tests 2025-09-29 13:13:40 +02:00
Jorge Manrubia e1f052935a Add test for triaging cards 2025-09-28 22:02:34 +02:00
Jorge Manrubia e14262dc01 Fix tests, remove workflow controllers 2025-09-28 18:50:26 +02:00
Jorge Manrubia 67d57cb02a Make sure column-related methods keep things consistent 2025-09-26 11:33:47 +02:00
Jorge Manrubia 2f6a639682 Prepare entropy code for the new auto postpone approach 2025-09-24 16:22:42 +02:00
Jorge Manrubia b63a6b3e97 Add postponable concern 2025-09-24 14:37:14 +02:00
Jorge Manrubia f1d76a7cb7 Exclude inactive users
The system user should never be a subsriber but we should not serve it if it is
2025-09-17 13:26:53 +02:00
Jorge Manrubia b5a2c4a25e Tidy up code a bit 2025-09-16 13:18:13 +02:00
Jason Zimdars e68b344cc2 Remove _Everything_ inolvement 2025-09-11 12:34:31 -05:00
Jorge Manrubia 7f7ecf0346 Delete notifications when the user loses access to the collection 2025-09-10 10:24:20 +02:00
Jorge Manrubia 2e51a34694 Extract method to fetch all the notifications for a card for a given user
We'll need to handle access changes
2025-09-10 10:08:14 +02:00
Jason Zimdars aa13853ae4 Add a third, "On deck" column in Collections 2025-08-12 17:58:12 -05:00
Andy Smith 07a470a8ac Update tests 2025-07-28 13:12:53 -05:00