Commit Graph

40 Commits

Author SHA1 Message Date
Mike Dalessio 14aa95d982 Add migration script to fix misplaced comment events (#2487)
Finds comment events that are on the wrong board (after a card move)
and updates them to the correct board.
2026-02-04 15:27:33 -05:00
Mike Dalessio a9c6bc2a28 Add migration to remove draft cards from search index
One-time script to clean up any search records that were indexed
before the searchable? guard was added.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 12:13:10 -05:00
Rosa Gutierrez bf224b19f5 Add rollback script to convert relative URLs back to absolute 2026-01-14 11:01:42 +01:00
Rosa Gutierrez bf6fe75b7c Add a script to migrate existing rich texts to relative URLs 2026-01-14 11:01:42 +01:00
Jeremy Daer 006e61ea58 Allow ActionText embed reuse and safe purge (#2346) 2026-01-12 10:30:18 -08:00
Fernando Álvarez dbb8113080 Extend the number of Beta environments 2025-12-23 12:27:03 +01:00
Jeremy Daer bd6c1cf34f Storage: harden reconcile for concurrent writes and fix board transfer (#2096)
* Storage: harden reconcile for concurrent writes and fix board transfer

Reconcile now uses two-cursor approach: captures cursor before and after
the storage scan, aborting if they differ (entries added during scan).
Job retries 3x with 1-minute waits and limits concurrency to 1 per owner.

Board transfer now correctly moves storage for card description embeds
and comment embeds, not just direct attachments. Uses batched queries
to handle cards with thousands of comments efficiently.

Also fixes N+1 queries in attachment grouping via lookup maps.

* Storage: fix per-attachment reconcile and enforce no blob reuse

The storage ledger tracks per-attachment (not per-blob) as a business
abstraction for quotas. This fixes reconcile to match that model and
adds enforcement to prevent blob reuse in tracked contexts.

* Reconcile now uses joins(:blob).sum() for per-attachment counting
* New validation prevents reusing blobs across tracked attachments
* Race-safe storage_total creation with create_or_find_by
* Job efficiency: skip find_by when object already available
* Backfill script checks per-attachment, not just per-blob
2025-12-19 13:07:32 -08:00
Samuel Péchèr 6b427ad9b9 Update timestamp 2025-12-18 17:34:47 +00:00
Samuel Péchèr 60dc6927fe Remove attachment detection 2025-12-18 17:34:25 +00:00
Samuel Péchèr d250c256c6 Add paragraph space to seed Card #8 2025-12-18 09:27:56 +00:00
Samuel Péchèr b2017a75cf Add script to separate non-blank sibling <p> 2025-12-18 09:27:56 +00:00
Jeremy Daer 761d0b4a76 Speedy, auditable, deadlock-resistant storage tracking (#2026)
An append-only storage ledger replaces deadlock-prone synchronous
counter updates and drift-prone async updates.

All content storage (card images, card/comment/board description embeds)
is tracked. Account exports (which expire) and avatars are not tracked.

Storage is accounted for by Account and Board. Both consume the same
event stream independently: no bubble-up storage bumps triggering
deadlocks due to lock sequencing. Each calculates its own total from
the underlying ledger with independent cursors and materialization.

* Storage::Entry: Append-only ledger recording attach/detach/transfer
  events with delta bytes. Single event stream indexed for both
  Account and Board cursor queries.

* Storage::Total: Polymorphic snapshot cache with cursor (last_entry_id)
  tracking which entries have been materialized.

* Storage::Totaled concern: Provides bytes_used (fast snapshot) and
  bytes_used_exact (snapshot + pending) query modes, plus
  materialize_storage! to roll up pending entries.

* Storage::Tracked concern: For models owning attachments (Card,
  Comment, Board). Provides board_for_storage_tracking for models
  where board is determined differently (Board returns self).
  Handles board transfers by recording transfer_out/transfer_in entries.

* Storage::AttachmentTracking: Hooks ActiveStorage::Attachment lifecycle
  to record attach/detach entries. Handles ActionText::RichText embeds
  by traversing to the actual model. Snapshots context in before_destroy
  to handle cascading deletes where parent record may be gone by
  after_destroy_commit.

* MaterializeJob: Rolls up pending entries into snapshot. Concurrency
  limited per owner to prevent duplicate work.

* ReconcileJob: On-demand reconciliation against actual attachment
  storage for support/debugging. Compares ledger total to real bytes
  from card images, card embeds, comment embeds, and board embeds.

Usage:
* account.bytes_used / board.bytes_used: fast, slightly stale bytesize
* account.bytes_used_exact / board.bytes_used_exact: real-time bytesize
* Storage::Entry: audit trail for debugging and point-in-time queries
2025-12-10 16:04:30 -08:00
Jeremy Daer bec46e15a9 Drop defunct Account upload attachments (#2030)
Controller and routes removed in 6a62df470c
2025-12-09 00:36:39 -08:00
Mike Dalessio e174206233 Add backfill script for verified_at timestamps
Identifies users who have demonstrated authentication by looking for
evidence of real activity: owners, content creators (cards, comments,
boards, events), action takers (assigners, closers, postponers,
reactors, pinners, filter creators), board accessors, export requesters,
push subscribers, setup completers, and users with active sessions.

Run this script after deploying the verified_at column to backfill
existing users before enabling the notification guard.

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 21:51:44 -05:00
Mike Dalessio 6345aa4787 Update seeds to use @example.com
See also https://www.rfc-editor.org/rfc/rfc2606.html
2025-12-03 15:40:58 -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 39ec6cf062 Replace collection with board in the code, tests green 2025-11-05 13:41:12 +01:00
Jorge Manrubia 03a345609e Baseline replacing collection with board across code 2025-11-05 13:31:54 +01:00
Stanko Krtalić 98755844a1 Remove the internal API
* Bind sessions to identities
* Remove references to the identity token
* Move email changes to identity
* Move account menu into a turbo-frame
* Create tenants from a tenanted route
2025-10-31 16:26:08 +01:00
Stanko K.R. 79b012f319 Add Join Codes 2025-10-31 16:24:30 +01:00
Stanko K.R. 5cef4ffeb0 Add sign in flow using magic links 2025-10-31 16:22:12 +01:00
Jorge Manrubia 5eb5e4b007 Add buttons to move columns left and right 2025-10-29 16:15:25 +01:00
Jorge Manrubia 1547cfd651 Merge pull request #1414 from basecamp/remove-summaries
Remove AI summaries and semantic searches
2025-10-29 12:00:57 +01: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
Fernando Álvarez 3946733b65 Migrate to box-car.com 2025-10-28 18:44:25 +01:00
Jorge Manrubia 392bdae316 Rename highlights -> summary 2025-10-25 20:06:57 +02:00
Mike Dalessio 73fa235bae Delete unnecessary migration helper script 2025-10-14 16:32:24 -04:00
Mike Dalessio 3399e45130 Introduce an "Identity" model to ease login
- New untenanted Identity and Membership models
- New `identity_token` cookie with path "/" holds state across tenants

We're not sure whether the untenanted database will be sqlite or
MySQL, and so I've been careful to minimize

- database reads, placing them behind etags and caching
- database writes, only writing when a new Session is created (login)

Note that we track two things in the identity_token cookie: a signed
id, and the updated_at for the underlying Identity object. This allows
us to effectively cache on the Identity without having to hit the
database, by using an Identity::Mock object that is compatible with
etag and cache methods.

The new integration test shows the desired user-facing behavior, which
is to make it easy to login without a tenanted URL and to jump between
tenants.

- the untenanted "login_help" page shows all linked memberships
- the jump menu shows all linked memberships (except the current)

Also introduced a utility script to populate existing employee
Identities, grouping accounts by email address.
2025-10-10 10:12:25 -04:00
Jorge Manrubia 3e67da7d0e Add a new join model to link summaries with users
So that changing the set of events does not result in not being able to find a generated highlight summary
2025-10-06 12:33:28 +02:00
Mike Dalessio 8e0cb930af Delete SignalId concerns from the codebase
including Signup for now, will rebuild it with just QB
2025-10-03 14:06:51 -04:00
Mike Dalessio 3cc0fd8c1f Add a script to generate unique passwords per email address
as part of the migration away from 37id/Launchpad.
2025-10-02 16:44:22 -04:00
Mike Dalessio 47370084d2 Remove code related to Launchpad auth or 37id Users 2025-10-02 16:33:23 -04:00
Jorge Manrubia 0969a30961 Fix script condition 2025-09-27 07:52:37 +02:00
Jorge Manrubia 6a231b48f2 Fix: script should consider old considering cards as belonging to the stream now 2025-09-27 07:42:04 +02:00
Jorge Manrubia cd025447f2 Add basic column models and script to migrate 2025-09-24 13:15:03 +02:00
Jorge Manrubia f4ad6800f3 Script to migrate comments to new URL scheme 2025-09-10 12:24:15 +02:00
Jorge Manrubia e15cc80929 Only process summaries for active users (not deactivated or system) 2025-09-05 13:46:28 +02:00
Jorge Manrubia 4bcc1627e8 Tweak script 2025-09-02 10:56:21 +02:00
Jorge Manrubia dfbc77c2e5 Render weekly highlights considering periods of inactivity 2025-09-01 17:09:43 +02:00
Mike Dalessio db6b700da8 Clean up the /scripts directory
Not removing anything, just organizing scripts into subdirectories to
make it a bit more readable.
2025-07-21 09:07:15 -04:00