Commit Graph

45 Commits

Author SHA1 Message Date
Jeremy Daer b23a5d0b7c Fix flaky tests caused by leaky show_exceptions twiddling (#2028)
Rails memoizes `@app_env_config`, so running push subscriptions test
after join codes test will result in running with `show_exceptions:
:none`, causing RecordInvalid to raise instead of returning 422 status.

References #1996
2025-12-08 23:27:36 -08:00
Mike Dalessio abe48f0efa Ensure user toggles on board edit page are cached properly
Not including the disabled flag as part of the cache resulted in
issues like the one described in #1992
2025-12-08 14:21:56 -05:00
Mike Dalessio 0160f215f2 Validate email before creating identity during sign-up and sign-in
Avoid Sentry exceptions when attackers try to stuff invalid emails. The
browser performs form field validation that should normally prevent this
from occurring, so we just return 422 without validation error messages.

Also:

- extract redirect_to_session_magic_link helper
- some controller refactoring and cleanup
2025-12-06 16:52:16 -05:00
Carmine Paolino c9eb44119d Fixed typo in VCR filters (#1929)
I know it's a small thing, but I just noticed that 🤷

Be careful if you reintroduce your old VCRs as they have OPEN_API_KEY
2025-12-04 08:58:12 -08:00
Jorge Manrubia e1e9a01720 Make open source the default, and check for sass instead 2025-11-28 15:53:48 +01: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
Kevin McConnell b4f3ee5d86 Include broadcast test helpers
We were relying on these without explicitly including them, leading to
flaky tests.
2025-11-17 09:12:41 -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
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
Kevin McConnell a81986816f Move test-related UUID helper 2025-11-17 09:12:31 -05:00
Kevin McConnell 63f8a9af78 Deterministic fixture UUIDs 2025-11-17 09:12:31 -05:00
Kevin McConnell 6c04b56f4b Compact the UUIDs to base36 2025-11-17 09:12:31 -05:00
Mike Dalessio e4011ef211 Update primary keys on customer data to UUIDs
- schema changes to primary and foreign keys
- fixture changes
- customer data models subclass AccountScopedRecord
- import script updated
2025-11-17 09:12:30 -05:00
Stanko K.R. 1d6dd09272 Update fixutres 2025-11-17 09:11:42 -05:00
Mike Dalessio bca4318cd4 Turbo test helper 2025-11-17 09:11:42 -05:00
Mike Dalessio 157708aeb8 test: Set up Current.account to get more tests passing
this is hacky so I left a todo to come back and unwind this
2025-11-17 09:11:42 -05:00
Mike Dalessio 006aa4d6b3 Tests need to set up the script_name properly
which requires tweaking fixtures for the memberships and the account
2025-11-17 09:11:42 -05:00
Mike Dalessio 362427b383 More changes to get setup and tests to run 2025-11-17 09:11:42 -05:00
Jorge Manrubia aa1ffb3357 Remove AI summaries and semantic searches
We were not using either. We can restore if we revisit.
2025-10-29 11:55:32 +01:00
Mike Dalessio 48783824ee Fix some small things related to accounts 2025-10-03 16:55:00 -04:00
Mike Dalessio 320558919c Rename LOCAL_AUTHENTICATION to OSS_CONFIG 2025-10-02 16:44:24 -04:00
Mike Dalessio 2630e4bd74 Extract 37id and QB controllers, models, and tests 2025-09-13 16:03:02 -04:00
Mike Dalessio 8f39c015ea Tests now pass with local authentication
This is the first step of a multi-step SaaS engine extraction.

Looking ahead to an open source release, we need to make sure that
local authentication is treated as an "official" option, and not just
a hack I added for Kevin to do load testing outside our DC. So this PR
gets to green, and adds a CI step in "local authentication" mode.

This all probably feels a little hacky to you, Reader, but the goal of
this change is to ease the next step, which will be extracting the
37id and Queenbee integrations into a proprietary "SaaS mode" engine.

In service of that goal, this commit simply wraps all of the dependent
code and tests with a conditional check on
`config.x.local_authentication`.
2025-09-13 15:21:00 -04:00
Jorge Manrubia 0c979a41c5 Format 2025-09-02 11:12:33 +02:00
Jorge Manrubia 5b68750713 Generate weekly highlights instead of daily ones
https://3.basecamp.com/2914079/buckets/37331921/todos/9010176047
2025-09-01 16:01:19 +02:00
Mike Dalessio 5540b0fd1b Make sure session cookie has the correct path for the tenant
ref: https://fizzy.37signals.com/5986089/collections/7/cards/1234
2025-08-10 18:53:52 -04:00
Mike Dalessio 360e22feb0 Move testing setup for path-based tenanting into test helper
This was previously in the AR::Tenanted branch we were using, but
feels like it doesn't belong in the gem.
2025-08-10 18:53:33 -04:00
Mike Dalessio 57269b1b9c Allow local authentication with LOCAL_AUTHENTICATION=1
You can touch `tmp/local-auth.txt` to persist this setting.
2025-08-06 17:05:35 -04:00
Jorge Manrubia f4147bda27 Support completed by via natural language 2025-07-03 15:52:11 +02:00
Mike Dalessio 73ba0c074f Introduce a Signup model and integrate with QB/37id
- Creates a Queenbee::Account
- SignalId peer classes work properly
- Set up a basic template for the account (closure reasons, workflow, collection)
- Load signal_id fixtures during `bin/setup --reset`
- Update signal_id to pull in the Fizzy product
2025-06-20 15:16:57 -04:00
Mike Dalessio 192c6036bc Account belongs to Signal::Account 2025-06-20 15:16:56 -04:00
Jorge Manrubia b9ec71ff84 Format 2025-06-05 15:21:18 +02:00
Jorge Manrubia 3df7d3e5a8 Match requests by body
So that modifying the prompt make the tests fail

If not, the tests defeat their purpose!
2025-06-05 12:45:45 +02: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 ecf82d8703 Make tests pass with action text 2025-05-29 12:37:16 +02:00
Jorge Manrubia b8f94c4ecb Add VCR and some initial tests 2025-05-16 13:29:18 +02:00
Jorge Manrubia aa3acfeaa8 Add plain text mentions 2025-04-22 11:26:56 +02:00
David Heinemeier Hansson 883a225946 Use upstreamed assert_in_body 2025-04-19 10:08:08 +02:00
David Heinemeier Hansson fd21838f88 Add assert_in_body helper
Coming upstream
2025-04-18 16:06:30 +02:00
David Heinemeier Hansson 7adbd8d634 Use card rerendering instead of redirects 2025-04-17 15:20:27 +02:00
Kevin McConnell 16a80ff3a6 More dynamic activity scores
This introduces a more dynamic system of activity scoring, to improve
the way bubbles "bubble up" due to their activity. There are a few
different parts we can tune here, and it's likely we'll need to make
adjustments once we get a feel for how this works in practice.

The basic idea here is:

- We assign points for certain types of event that happen on a bubble. A
  boost gets 1 point, a comment gets 10 points, and so on.
- These points decay over time, at a rate of 50% per day. So old
  activity is worth much less than new activity. Bubbles should rise up
  quickly when acted upon, bit will float back down if left idle.
- Some comments can score higher than others: the first comment from
  each person on a bubble is worth more (20) because it signals that
  more people are getting involved; and comments that follow a comment
  by a different author are also worth more (15) because that signals
  there's ongoing conversation between people, not just a series of
  notes being left by one individual.

In terms of implementation, we persist the score on the bubble
whenever it changes, but we handle the decay on the client side. That
allows us to cache the bubble representation without having to
continually change it while its activity decays.

We also keep a separate `activity_score_order` attribute on the model.
This can be used to sort the bubbles in order of "most active", without
having to think about the decay.
2025-03-05 17:16:31 +00:00
Kevin McConnell c4fb1bdc76 Add minimal authentication flow to get started 2024-06-21 16:45:29 +01:00
Kevin McConnell 564a0f48ae New Rails app 2024-06-21 13:19:56 +01:00