You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Added
WhatsApp rotator per short link (accounts only). A link can hold up to 10 WhatsApp numbers, each with a weight (1 to 100) and an optional prefilled message; every visit goes to https://wa.me/<number>?text=... of one of them, in turn (round robin) or by weight (a fixed cycle as long as the weights add up to, so the shares are exact). Numbers are stored as digits with the country code and no + (8 to 15 digits, not starting with 0); anything else is refused with a translated error. The message is checked like a destination (the safety checks run on the real wa.me address and the words in the text) and is always URL-encoded. The turn comes from links.wa_cursor, moved by one UPDATE ... + 1 inside a transaction, so concurrent visits never take the same turn; an ordinary link does no extra query, and crawlers get the first number without using up a turn. Every visit is still counted as before; link_clicks.variant records the number's stable id, and the link's statistics page shows the count of each number. The create dialog and the edit page have a "WhatsApp rotator" section; a rotator has no destination of its own, so the destination is the first number's address, and routing rules, the split and the app opener are switched off while it is on. Guests cannot make one (the guest form refuses the fields). Migration 2026_11_13_000001 adds wa_mode, wa_numbers and wa_cursor and is reversible.
Claim token for guest links. A browser that makes a guest link receives a random claim token in the hop_claim cookie (HttpOnly, Secure, SameSite=Lax, 30 days); only a keyed hash of it is stored (links.claim_token_hash), and the token never appears in a URL, a log line or a response body. After signing in, that browser sees "You made N links before signing in" with a Claim button on the dashboard and on My links; claiming moves those links to the account in one statement, once, and only links that are still unowned, active, not flagged, not reported and not expired, then clears the cookie. POST /links/claim is rate limited (6 a minute). A link id without the cookie claims nothing. The per-address guest limits (creator_hash) are unchanged. Migration 2026_11_13_000002 adds the column and its index and is reversible.
Claiming respects the account's active-link limit (limits.user.max_active_links): the oldest guest links move first, as many as fit, the message says how many are left (Not claimed yet: N ...) and the claim cookie stays so the rest can be claimed after some links are removed or switched off.
App store link: one short link that sends each system to its own app store. The create dialog and the edit page have an "App store link" choice with four optional addresses (Google Play for Android, the App Store for iPhone and iPad, the Mac App Store for macOS, the Microsoft Store for Windows; at least one is needed). Everyone else (Linux, ChromeOS, crawlers, any other system) goes to the link's destination. Each address has to be an https:// page of its own store, otherwise the error names the store; it also passes the same safety checks as any other address. The form writes ordinary routing rules (one per filled store, with a store marker), so the redirect works as routing rules always did, and the edit page shows them back in the store form; a link whose rules were changed by hand into something the form cannot show opens in the routing rules editor with nothing lost. The API takes the same through routing_rules (the API docs page has an example). It is for accounts, like routing rules, and not combined with the WhatsApp rotator; with the A/B split the store rule comes first, and with "Open in the app" the visitor is routed first and then the store's own app opens.
Changed
The claim cookie's Secure flag follows session.secure (SESSION_SECURE_COOKIE, which defaults to "APP_URL is https"); only an explicit false turns it off, so the claim flow can be tried on local http and production stays Secure.
WhatsApp rotator numbers take the smallest free id (never above the list length, so always within the unsigned tiny integer link_clicks.variant, which the A/B split shares). Each number records when it was added and only clicks from then on count for it, so a reused id, or the variants of an earlier A/B split, no longer show up as that number's clicks.
"Open in the app" (auto mode) now takes the known apps from the shared hop/safetyDeepLinks. Same apps, same addresses, but stricter, and every case below is a plain redirect (the page opens as before), never an error: only https:// destinations are deep-linked (an http:// one no longer is); the host must match a whole name (evilzoom.us is not zoom.us) and may not carry a port or user info; YouTube is limited to watch, playlist, shorts, live and youtu.be links (a channel page is a plain redirect); an X post with a suffix (/user/status/123/photo/1) and a Spotify link with extra segments after the id are plain redirects too; and every piece of the destination is percent-encoded into the Android intent:// address, so ;, = and spaces of a typed address cannot add Intent fields. The custom mode (the owner types the app address) is unchanged. The edit page says "not recognised" for an http:// destination.