Commit Graph
22 Commits
Author SHA1 Message Date
isaaccladandClaude f2019dbb2a link: take click counters off the hot row to stop deadlocks
Deploy Ladill Link / deploy (push) Successful in 1m18s
Every click ran three UPDATEs against the same short_links row plus one against
the owner's link_wallets row, all inside one transaction. Two consequences:

- A popular link serialised its entire traffic through a single row lock.
- Locking two rows per transaction meant concurrent clicks on different links of
  the same owner could take them in opposite orders, so MySQL deadlocked.

Production logged 152 deadlocks, 146 of them on one row, surfacing as HTTP 500s to
real visitors. With a link now being handed to a very large audience, this is the
next thing that falls over, and it is independent of page weight.

Counters are now buffered and flushed instead of written inline:

- link_clicks stays the source of truth. It is insert-only, so it has no
  contention no matter how popular a link gets.
- Increments accumulate in Redis hashes and drain via link:flush-click-counters,
  scheduled every minute. The database sees one UPDATE per link per flush instead
  of four per click.
- Draining reads and deletes each hash atomically, so a click landing mid-flush is
  counted in that batch or the next, never dropped.
- --recount rebuilds totals from link_clicks after a Redis loss.

If the buffer is unavailable the recorder writes through to the database, keeping
today's behaviour (and today's contention) rather than losing counts. Nothing in
the click path may break the redirect the visitor actually came for, so the whole
recorder is wrapped and failures are logged.

Storage sits behind ClickCounterStore so the buffered path is covered by tests
rather than silently falling back to write-through when no Redis is present.

Also adds the (short_link_id, ip_hash, clicked_at) index. The unique-click check
filters on ip_hash but only (short_link_id, clicked_at) was indexed, so every
click scanned all of that link's rows in the dedupe window — cost growing with the
link's own popularity, the worst possible shape for a link going viral.

Tests: 11 new. The load-bearing one asserts the request path issues no UPDATE
against short_links or link_wallets at all.

Pre-existing suite failures go from 13 to 9; none of the remainder are related.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-25 11:38:12 +00:00
isaacclad e1ec3d57d5 Sync app launcher from registry
Deploy Ladill Link / deploy (push) Successful in 1m28s
2026-07-24 19:31:56 +00:00
isaacclad a1003bfa56 Stop Paystack pre-modal flash on customer checkout.
Deploy Ladill Link / deploy (push) Successful in 1m11s
Use the shared Inline sheet, hold busy until payment UI opens, and avoid locking page scroll during the handoff.
2026-07-24 10:14:40 +00:00
isaacclad 3f59935e23 Sync launcher after restoring Merchant/Mini/Give and adding One.
Deploy Ladill Link / deploy (push) Successful in 52s
2026-07-21 14:23:36 +00:00
isaacclad a9ddd600db Remove Merchant, Mini, and Give from the app launcher.
Deploy Ladill Link / deploy (push) Successful in 2m16s
Registry marks them soon pending BoG licensing; propagate the clean launcher so every app matches.
2026-07-15 13:28:38 +00:00
isaacclad 2c7021632f Sync app launcher from registry
Deploy Ladill Link / deploy (push) Failing after 2s
2026-07-07 00:21:33 +00:00
isaaccladandCursor 344bf76391 Add GeoIP country fallback for link click analytics.
Deploy Ladill Link / deploy (push) Successful in 39s
Resolve countries from CDN headers first, then MaxMind GeoLite2 via visitor IP, with an artisan command to download and refresh the database.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-04 23:36:01 +00:00
isaaccladandCursor 1742fb859f Fall back to Events when platform QR proxy returns 404.
Deploy Ladill Link / deploy (push) Successful in 48s
Event pages like sales-webinar live on events.ladill.com, but ladl.link
only proxied to ladill.com/q/* — fix by retrying events.ladill.com when
the platform hub has no matching code.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-02 08:19:29 +00:00
isaacclad c73a0d869b Sync app launcher from registry
Deploy Ladill Link / deploy (push) Successful in 43s
2026-07-01 17:04:36 +00:00
isaacclad dd2ecb5501 Add Queue to app launcher config and icon.
Deploy Ladill Link / deploy (push) Successful in 42s
Propagated from ladill monorepo launcher sync.
2026-06-29 22:12:15 +00:00
isaaccladandCursor c5e92012ff Fix ladl.link transfer QR redirect loop causing 500 errors.
Deploy Ladill Link / deploy (push) Successful in 1m1s
Proxy transfer paths directly to transfer.ladill.com and stop following ladl.link redirects server-side so recipient links resolve.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-29 20:55:48 +00:00
isaacclad dab2ca8100 Sync app launcher from registry
Deploy Ladill Link / deploy (push) Successful in 1m19s
2026-06-29 13:29:03 +00:00
isaaccladandCursor 2d89f6ef67 Sync mobile profile wallet card and 24h session idle timeout.
Deploy Ladill Link / deploy (push) Successful in 36s
Show wallet balance prominently in the mobile profile bottom sheet with refresh
on open; align session lifetime with the platform default.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-28 12:46:20 +00:00
isaacclad 27e80260f6 Sync app launcher from registry — add Frontdesk.
Deploy Ladill Link / deploy (push) Successful in 26s
2026-06-28 01:46:11 +00:00
isaaccladandCursor 9d89aef17e Sync app launcher from registry
Deploy Ladill Link / deploy (push) Successful in 32s
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-27 19:03:57 +00:00
isaaccladandCursor 6f8c5da728 Sync app launcher from registry
Deploy Ladill Link / deploy (push) Successful in 35s
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-27 18:28:04 +00:00
isaaccladandCursor 29993040bd Read Afia AI credentials from platform admin settings.
Deploy Ladill Link / deploy (push) Successful in 58s
Link Afia now resolves provider, model, and API keys from ladilldb.platform_settings like the monolith, with .env fallbacks for local dev.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-27 14:34:43 +00:00
isaaccladandCursor 5a3631cd2e Fix Afia AI assistant for Ladill Link.
Deploy Ladill Link / deploy (push) Successful in 31s
Wire the chat route and Link-scoped system prompt, include the Afia panel in the main layout, and point the UI at link.afia.chat instead of the copied QR Plus route.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-27 14:31:00 +00:00
isaaccladandCursor b4ad797c38 Use shared signed-out page with Ladill Link branding.
Deploy Ladill Link / deploy (push) Successful in 50s
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-27 12:40:12 +00:00
isaaccladandCursor 9516fcb9f3 Expand Link app with analytics, settings, and custom domains.
Deploy Ladill Link / deploy (push) Successful in 37s
Add Bitly-style branded domain support via Ladill Domains SSL API,
account analytics dashboard, settings page with default domain picker,
and fix SSO/dashboard issues from QR Plus template leftovers.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-27 12:16:34 +00:00
isaaccladandCursor d9c91ad7d8 Add Ladill Link URL shortener on ladl.link.
Management UI at link.ladill.com with GHS 0.05 per link wallet billing,
click analytics, and legacy fallback to ladill.com/q for QR ecosystem codes.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-27 10:58:41 +00:00
isaacclad 04e4f6ab51 Bootstrap Ladill Link from QR Plus extract template. 2026-06-27 10:54:31 +00:00