Dandelion is a fair source project. View the code on Github · See the design guide

Commits on Oct 11, 2026
d735015

Check Order#revenue_sharer_id rather than loading the revenue sharer in the credit and fixed discount splits. Event#credit_on_behalf_of_revenue_sharer and fixed_discounts_on_behalf_of_revenue_sharer call these for every order, and each call loaded the Account, even for orders with no credit or discount. On GET /pmails/:pmail_id/edit, a stats row cache miss for an event with about 45 orders ran 45 account queries, and the ticket revenue to revenue sharer cell took 667 ms of a 2.4 s request. Results are unchanged: deleting an account nullifies revenue_sharer_id on its orders, so the id is never left pointing at a missing account.

213691d

Cache Event#donation_revenue_less_application_fees_paid_to_dandelion in its own instance variable. It shared @donation_revenue (and @donation_revenue_without_transferred) with donation_revenue, so whichever was called first on an event set both. The one place both run is /events/:id/donations, whose nav renders the stats row before the page says how much was received: for a Stripe Connect organisation, on a stats row cache miss, that figure would have included donations to Dandelion. No production event has both (every event with donations to Dandelion belongs to an organisation without Stripe Connect, and none is cohosted by one), so nothing was shown wrong.

4ab63b9

Sum event revenue from plucked amounts and currencies rather than loading every ticket, order and donation. On /events/:id/tickets for an event with 944 paid tickets, the ticket revenue cell took about 700 ms of a 2.6 s request: it built every ticket, and the tickets query also eager-loaded their accounts, ticket types and orders, which @event.tickets.includes in the controller had added to the event's tickets association. pluck reads two or three fields and never eager-loads. The Money arithmetic is unchanged, so totals are identical to the penny (a Mongo aggregation couldn't match Money's half-up rounding of floats). Covers discounted_ticket_revenue, the organisation and revenue sharer shares, credit_applied, fixed_discounts_applied and the donation totals.

51b8d43

Explain tracing in AGENTS.md

Traces are saved to Mongo rather than sent to Sentry, so say where to find them and how to read their compressed spans

aa99eaa

Send no transactions or profiles to Sentry, just errors and logs

Every request is still traced and saved to the traces collection, but before_send_transaction now always returns nil. Drops the Vernier profiler and SENTRY_SAMPLE_RATE, and client reports, which would otherwise count every dropped transaction.

e8d1eb2

Say outright that unclashable tokens still get a unique index

80dd45e

Make sign in tokens shorter and dashless

The token is now the time it was made in base 36 (7 characters) followed by 16 random letters and digits: 23 characters instead of 43, and double-click selects all of it when pasting a sign in code. Old timestamp-hex tokens are still read until they expire. Also drops unique_sign_in_token's exists? loop.

0c09551

Drop uniqueness validations on random tokens that can't clash

token, ics_key, sign_in_token and DragonflyJob#uid are SecureRandom values, so the validation (and the exists? retry loops) only cost a query on every create. Their unique indexes stay.

3d80c0c

Save each trace's release commit time so /stats/traces needs no lookups

Listing releases looked up every release's commit time on the first load after a deploy, falling back to the GitHub API, which took seconds as releases accumulated

03031a9

Don't fail listing event indexes before the events collection exists

7729701

Show See all events as a link rather than a button

Claude-Session: https://claude.ai/code/session_01UeNG7TEDVA7FLp6demhNTV

92c449c

Cap unpaginated organisation event lists at 100 events

The events grid and the list in an embed (minimal=true) rendered every event from the from date on: with from=2026-01-01, about 420 for The Psychedelic Society, which took 7-25s. Show the first 100 and a link to the paginated list with the same filters.

Claude-Session: https://claude.ai/code/session_01UeNG7TEDVA7FLp6demhNTV

3c05032

Style popular locations like carousel buttons, sharing a .filter-buttons class

8b52375

Hint the hosts index for organisation event queries

MongoDB couldn't keep a cached plan for events_including_cohosted: a plan cached for a small organisation fails its efficiency check on a large one, so the query was replanned each time, spending 0.4-0.6s planning (41 candidate plans) for a 23ms scan. Event.hinted gives the index as a hint where it exists, which it doesn't in tests or most development databases.

Claude-Session: https://claude.ai/code/session_01UeNG7TEDVA7FLp6demhNTV

50be3a5

Match organisation events on hosts_ids_cache rather than an $or

Organisation#events_including_cohosted now queries the single hosts_ids_cache field, so MongoDB can cache its plan and use the date conditions as index bounds (16ms rather than 646ms for the largest organisation on production). Needs hosts_ids_cache backfilled and indexed before it's deployed.

Claude-Session: https://claude.ai/code/session_01UeNG7TEDVA7FLp6demhNTV

a45a499

Add hosts_ids_cache to events, kept in sync but not yet read

The organisation and its cohosts in one field, so that Organisation#events_including_cohosted can match a single equality instead of an $or (which MongoDB replans on every query: 0.5-0.8s for the largest organisation). Set on validation and by cohostship create/destroy alongside cohosts_ids_cache. rake db:hosts_cache_sync checks and repairs it, and backfills existing events with FIX=1.

Claude-Session: https://claude.ai/code/session_01UeNG7TEDVA7FLp6demhNTV

c848067

Load profile page events once instead of also checking exists?

Claude-Session: https://claude.ai/code/session_01UeNG7TEDVA7FLp6demhNTV

6c397d1

Save the query string and user agent on traces

Sentry's request url leaves out the query string, so /stats/transactions couldn't tell e.g. pages of a paginated pagelet apart. Values of query parameters that can sign someone in or grant access are filtered. The user agent tells crawlers apart from people.

Claude-Session: https://claude.ai/code/session_01UeNG7TEDVA7FLp6demhNTV

9cbfeac

Reject non-XHR requests to the organisation events pagelet

A redirect sent every crawled page link on to a full organisation page render. Halting with a 400 before the lookup does no work, and tells crawlers the URLs aren't pages.

Claude-Session: https://claude.ai/code/session_01UeNG7TEDVA7FLp6demhNTV

bdc782a

Speed up the organisation events pagelet

events/blocks loaded the events once to check exists? and again to list them. With a skip (later pages), MongoDB took 0.5-0.9s planning the exists? query for large organisations, so check the loaded records instead.

Crawlers followed the pagelet's pagination links directly (non-XHR), walking every page of /o/:slug/events_block. Send non-XHR requests to the organisation page.

Claude-Session: https://claude.ai/code/session_01UeNG7TEDVA7FLp6demhNTV