Commit Graph

114 Commits

Author SHA1 Message Date
Jorge Manrubia e1e9a01720 Make open source the default, and check for sass instead 2025-11-28 15:53:48 +01:00
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 9f117159a6 Restore structured logging of queenbee_id
and clean up some other small remaining "plan b" to-dos.
2025-11-24 15:50:45 -05:00
Mike Dalessio b2e3c7b1c7 Drop the "max previewable file size" limit
which was originally introduced to work around timing issues causing
us to try (and fail) to generate previews on sqlite read replicas.
2025-11-21 10:55:20 -05: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
Donal McBreen 19b0e25eac Split sqlite/mysql record stuff 2025-11-21 09:15:19 +00:00
Donal McBreen a682a807ed Handle SQLite date subtraction 2025-11-21 09:15:19 +00:00
Donal McBreen cc7e091508 Disable multi-db for SQLite 2025-11-21 09:15:19 +00:00
Donal McBreen a2333d9a37 Add SQLite support
- UUID support
- Schema compatibility layer, ignore MySQL specific options
- Search not working yet
2025-11-21 09:15:19 +00:00
Mike Dalessio 2c2a1c4b4a Make sure jobs are enqueued only after all transactions are committed
This should fix the recurring ActiveStorage::FileNotFoundError errors
from ActiveStorage::AnalyzeJob.

The issue is that, when images are not direct uploaded (e.g. a card
background image or avatar image), the AnalyzeJob has been getting
enqueued before the file itself was uploaded to blob storage.

Setting ActiveJob::Base.enqueue_after_transaction_commit = true makes
sure that jobs are always enqueued only once *all* transactions have
been committed.

This will be the Rails default at some point, but for now we still
need to explicitly set it.

Big thanks to @jeremy for the assist. 👏
2025-11-20 18:47:42 -05:00
Stanko K.R. e8a7b19647 Retry file analisys on FileNotFoundError 2025-11-20 15:09:43 +01:00
Kevin McConnell 9b3b2f5d29 Prevent pinning writes in non-primary DCs 2025-11-18 11:03:58 +00:00
Mike Dalessio d8f935498a ActiveRecord::Type::Uuid#hex
to make it easier to convert when we have to look in the logs
2025-11-17 20:04:43 -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
Donal McBreen a8412449e3 Don't cast and extract normalization
We are not trying to handle user input so `cast` can be a no-op. Also
extract the base36 normalization logic, let the binary class handle the
serialize encoding and add some tests.
2025-11-17 09:12:36 -05:00
Donal McBreen 8ec5c1af5c Use Binary::Data for serialization
This handles quoting for us automatically
2025-11-17 09:12:36 -05:00
Donal McBreen f6ec9bbeea Use a custom class for Uuid values 2025-11-17 09:12:35 -05:00
Donal McBreen fc56ad9d7c Combine uuid-old and uuid branch changes
- Switch to binary 16 for UUID keys
- Remove AccountScopedRecord base class, all model use binary uuids now
- Fix the search sql to serialize uuids properly
- Patch the MySQL schema dumper to output binary lengths
2025-11-17 09:12:34 -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 e8abc66eba MySQL search
Add a single search_index table for full-text search of cards and
comments.

For the search there is a full-text index on the title and content
columns. The board_ids is also included in the table and accessible
board ids are pre-loaded and included in the search query. This allows
us to filter out inaccessible records before joining with other tables.

Right now the search is just using boolean search. This would give us
a bunch of syntax options
(see https://dev.mysql.com/doc/refman/8.4/en/fulltext-boolean.html)
except the search query filters those out.

I've removed the searchable_by method for now - everything is built
on the assumption that there's a single search index table and all data
must fit into it.

Queries are written in SQL, we don't have a SearchIndex ActiveRecord
model. That's because we'll likely want to shard the table and it will
be simpler to just keep with the raw SQL for that.

There's no stemming, highlighting or snippet extraction yet - we are
dumping the full description in the search results.

Data can be reindexed with the search:reindex rake task.
2025-11-17 09:12:17 -05:00
Mike Dalessio d41d50d52b Account.sole → Current.account
and some other de-tenant changes, including removing the controller
tenanting concerns
2025-11-17 09:11:40 -05:00
Jorge Manrubia e8920ceb0e Prevent page refreshes when posting comments/descriptions with attachments 2025-11-13 16:03:48 +01:00
Jason Zimdars 0f28ded99e Send email from support@fizzy.do 2025-11-11 10:47:30 -06:00
Fernando Álvarez 514c0f45a2 Migrate to fizzy.do 2025-11-04 13:17:10 +01:00
Jorge Manrubia 445ee48b0d Format 2025-11-04 05:07:26 +01:00
Jorge Manrubia 4e999eaf86 Use existing ARTENANT env var for selecting the tenant
Thanks Mike for the tip!
2025-11-03 15:04:06 +01:00
Jorge Manrubia ac507aa754 Add support for remote images in the seeding system 2025-11-02 09:24:38 +01:00
Jorge Manrubia e726335833 WIP for seeding accounts 2025-11-02 00:05:38 +01:00
Fernando Álvarez 7f78514a58 Move to app.box-car.com 2025-10-30 11:12:39 +01:00
Fernando Álvarez 3946733b65 Migrate to box-car.com 2025-10-28 18:44:25 +01:00
Mike Dalessio 320558919c Rename LOCAL_AUTHENTICATION to OSS_CONFIG 2025-10-02 16:44:24 -04:00
Mike Dalessio 4442964408 Introduce yabeda for Solid Queue metrics 2025-09-15 11:05:04 -04:00
Mike Dalessio 2630e4bd74 Extract 37id and QB controllers, models, and tests 2025-09-13 16:03:02 -04:00
Jorge Manrubia 218519d075 Configure letter opener 2025-08-26 10:21:13 +02:00
Mike Dalessio a711975904 Turn off attachment previews on large files
ref: https://fizzy.37signals.com/5986089/collections/7/cards/1302
2025-08-19 12:16:24 -04:00
Stanko K.R. c95e8678a9 Extract #all_emoji? to a Rails ext 2025-08-13 15:14:12 +02:00
Jason Zimdars a6e9e51071 Merge branch 'main' into web-push
* main: (28 commits)
  Clean up the /scripts directory
  Prevent recursion when invoking AI
  Bump sqlite3 from 2.7.2 to 2.7.3
  Port over Jeremy's fix for slow uploads
  .gitignore log files and portfolio's local storage
  Drop Current.account and just use Account.sole
  Use the utf8-patched mysql driver
  Call blob.preview for previewable attachments
  Make sure the image variants we use are preprocessed
  Add /user command
  Make sure it doesn't infer custom abbreviations when matching user names
  Script to load prod db in development
  Update Signup to use the queenbee_id for the tenant name
  Bump cache version
  Make sure it uses latest bundler to prevent error due to mismatch
  Invalidate cache
  Update ruby
  Update bundler to prevent error on lower version
  Update bundler to prevent error on lower version
  Resolve stages
  ...
2025-07-21 11:03:56 -05:00
Mike Dalessio 0a92fc3a16 Port over Jeremy's fix for slow uploads
ref: https://fizzy.37signals.com/5986089/collections/7/cards/944
2025-07-20 13:19:53 -04:00
Jason Zimdars 83f7bd4346 Use icon with background included 2025-07-15 21:40:04 -05:00
Jason Zimdars 7dbb9c7a9e Fix icon path 2025-07-15 18:47:44 -05:00
Jason Zimdars e59a994a0c Add db table and models 2025-07-14 19:57:30 -05:00
Jorge Manrubia fa04016cbe Revert "Revert "Replace House with Lexical"" 2025-05-29 14:25:16 +02:00
Jorge Manrubia 08d8b2e5ff Revert "Replace House with Lexical" 2025-05-29 14:22:27 +02:00
Jorge Manrubia 10b2aad647 Replace House with lexical-powered actiontext 2025-05-23 11:41:08 +02:00
David Heinemeier Hansson 48a6c05250 No longer used 2025-04-20 16:23:15 +02:00
Jorge Manrubia 17aa9b97e9 Monkey patch a prepend_order method 2025-04-11 10:28:12 +02:00
Jorge Manrubia 168a790687 Add a rails helper for the new custom stream action 2025-04-10 13:30:15 +02:00
Jason Zimdars 6872852d3f Embed additional video formats 2025-04-08 16:02:32 -05:00
Jason Zimdars 9b7d297027 Add rudimentary support for embedding videos 2025-01-30 16:47:42 -06:00