Skip to content
Merged

v2.3.0 #1510

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .agents/skills/e2e-dev-stack/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ E2E_BASE_URL=https://localhost:8443 MAILPIT_URL=http://localhost:8025 E2E_SAAS_M
- A queue worker must be running to deliver the verification emails: `docker compose -f docker-compose.dev.yml exec -d backend php artisan queue:work`.
- Superadmin-dependent specs need a one-time `php artisan dev:bootstrap --email=superadmin@e2e.test --password='SuperAdminPass123!'`.
- Seating and box office specs need `APP_LICENCE_KEY=development` in `backend/.env`.
- Audience text message specs need `SMS_DRIVER=fake` in `backend/.env` (they skip otherwise) and, like the feature-flag specs, a Hi.Events Cloud licence key so `crm_sms` can be switched per account.
- Audience specs that run scheduled jobs (`e2e/utils/artisan.ts`) rely on the queue worker; start it with `-e APP_EVENT_SPAM_CHECK_ENABLED=false`, or the "announce a published event" spec waits on the spam check.
- The dev nginx runs out of upstream ports (502s, blank pages) when many pages load at once; run large sets with `--workers=2`.
- `@stripe` specs need `STRIPE_SECRET_KEY`, the backend's `STRIPE_WEBHOOK_SECRET` and `E2E_STRIPE_CONNECT_ACCOUNT_ID` exported. Webhooks are handled by the queue worker, so poll for the result.

See "Against the running dev stack" in `e2e/README.md` for more.
15 changes: 14 additions & 1 deletion .claude/rules/backend/abuse-and-spam.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ paths:
- "backend/app/**/*Spam*.php"
- "backend/app/**/SpamEvents/**"
- "backend/app/**/*Suspicious*.php"
- "backend/app/Services/Domain/Message/**"
- "backend/app/Jobs/Message/**"
- "backend/app/Services/Infrastructure/Ai/**"
- "backend/app/**/*Turnstile*.php"
- "backend/app/Validators/Rules/PersonNameRule.php"
- "frontend/src/components/common/Turnstile/**"
Expand All @@ -11,7 +14,17 @@ paths:
# Abuse & spam

- Any new public order, waitlist or contact path must respect event status: public orders on non-LIVE events only for the event's own account and never on PENDING_MANUAL_REVIEW; waitlist joins and organizer contact require LIVE.
- New abuse signals go in `SuspiciousActivityDetector`.
- New abuse signals go in `SuspiciousActivityDetector`. Each finding needs a `nextStep`, and each item sets `accountId` where one exists so the report shows the account and links to its admin page (`?action=suspend` opens the suspend modal). Names and titles in the report go through `StringHelper::escapeMarkdown`; markdown mail otherwise renders `[text](url)` inside `{{ }}` as a live link.
- ARCHIVED events are spam-checked like LIVE ones (`EventSpamCheckService::CHECKED_EVENT_STATUSES`): on entering the status and on content edits. Approving a flagged event restores `previous_event_status`. Mail is not withheld while the first check runs; that window is accepted.
- Any user text that reaches a buyer's email belongs in `EventSpamCheckContentService`, and editing it dispatches a re-check through `EventSpamCheckDispatchService`. Custom email templates go in as raw Liquid source (hashed) plus a sample render (not hashed: the preview context is random); never strip Liquid, string literals print.
- Spam-review notices go to the account email, never `organizers.email` (unverified, free text).

## Message AI review

- With `MessageAiReviewService::isEnabled()` (SaaS mode, `APP_MESSAGE_AI_REVIEW_ENABLED`, an Anthropic key) an event message entering `PENDING_REVIEW` goes to `ReviewMessageWithAiJob` instead of `MessagePendingReviewJob`. It mirrors the CRM campaign check (`.claude/rules/ee/crm.md`); keep the two in step.
- `MessageAutoReviewService` stores the verdict in `messages.ai_review` (`decision` `APPROVED`/`NEEDS_PERSON`, `confidence`, `reasons`, `reviewed_at`) and only acts while the message is still `PENDING_REVIEW`. An approval at or above `APP_MESSAGE_AI_REVIEW_CONFIDENCE_THRESHOLD` releases the message through `MessageApprovalService::releasePendingReview`, the same path as an admin approval. Anything else (not approved, under the threshold, job failed) is recorded as `NEEDS_PERSON` and only then goes to `MessagePendingReviewJob`. The check never rejects or cancels a message.
- Anything that releases a held message goes through `MessageApprovalService`; its status changes are conditional on `PENDING_REVIEW`, so an admin and the check can't both release it.
- Message text is untrusted: everything entering a review prompt goes through `UntrustedPromptText` (angle brackets replaced, links listed separately), shared with the campaign check.
- The message body reaches the Markdown mail layout as one line inside a `<div>` (`StringHelper::onOneLine` in `EventMessage`), so Markdown typed into a message is never parsed into an image or link the checks did not see. The links limit (`checkTierLimits`) and the review read the purified body that is stored and sent, never the submitted one: the purifier decodes entity-encoded `href`s the raw text hides.
- A message containing an image (an `<img>`, or a CSS `url(…)` such as a background image, which the message purifier keeps) is never approved by the check and never sent to the model (it can't read images); it goes to a person. A retried job acts on the verdict already recorded instead of asking again.
- Test sends (`send_data.is_test`) don't count towards the daily message limit once delivered, but a test held for review does, so review requests stay capped. `POST events/{id}/messages` is throttled (`message-send`) below anything a real sender reaches, to bound test sends.
2 changes: 1 addition & 1 deletion .claude/rules/backend/lifecycle-emails.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ paths:
- Every candidate query must: exclude `users.lifecycle_emails_unsubscribed_at`; skip accounts nudged in the last 3 days (`quietPeriodStart()`); filter in SQL before `LIMIT`, never in PHP after it; and anchor its trigger on a timestamp old data can't move (never `updated_at` unless also bounded by a creation date after `enabled_at`). Marketing-flavoured nudges also require `users.marketing_opted_in_at`.
- A template's `enabled_at` is the cold-start cutoff; never backdate it. The one exception is `LAPSED_PAYER`, which on purpose reaches accounts that lapsed before it was enabled, within a fixed 18-month lookback anchored on the end of the last sold date.
- Every candidate query skips suspended accounts (`accounts.suspended_at`).
- Unsubscribe is a button on `/emails/unsubscribe/:token`, never unsubscribe-on-GET (link scanners prefetch).
- Unsubscribe is a button on `/emails/unsubscribe/:token`, never unsubscribe-on-GET (link scanners prefetch). The one-click `List-Unsubscribe` header address comes from `PublicApiUrl`, never from `APP_URL` directly (Cloud sets `APP_URL` to the frontend, where the API is under `/api`).
- `account_lifecycle_nudges` is claim-then-send: only transient failures (network, HTTP 5xx/429) release the claim and stop the sweep; any other rejection keeps the claim so one bad address never stalls it. Nudges are sent synchronously, not via `BaseMail`, so failures can be classified.
- Stripe nudges filter by signup timezone (`StripeConnectTimezones`); don't use `organizer_stripe_platforms.stripe_account_details->country`, because unfinished Express accounts report the platform default (`IE`).
1 change: 1 addition & 0 deletions .claude/rules/backend/team-access.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ paths:
- Treat any value that unlocks a public page as a credential. Staff responses return `orders.short_id` only to members with EDIT + VIEW_FINANCIALS; check-in list links are shareable with door staff on purpose.
- Deliberate, don't "fix": VIEW_FINANCIALS hides money in the dashboard but doesn't stop an EDIT member from configuring outbound channels (organizer email, email templates, analytics pixels) or running the door, which shows door sales.
- Free-text fields that tell buyers where to send money are payment settings. Changing an event's `offline_payment_instructions` needs MANAGE_PAYMENTS (Admins only by default) and a session: `UpdateEventSettingsRequest::after()` returns a 422 on the field for an API key or a member without it, on both PUT and PATCH. Re-sending the saved value (or one that purifies to it) always passes, so round-trips keep working; a PUT that omits it counts as clearing it. The payment settings form shows the instructions read-only to those members and re-sends the saved value. Same pattern as GTM containers in `PartialUpdateOrganizerSettingsRequest`.
- Turning ticket resale on or off (`allow_ticket_resale`, organizer `default_allow_ticket_resale`) needs ISSUE_REFUNDS, because resale refunds sellers from the organizer's Stripe account automatically. Same change-only check: re-sending the saved value passes, and both settings forms disable the switch for members without it.
- Public "same account" checks (draft previews, test orders, check-in staff view) use `AccountUserAccessService::currentMemberCanAccessEvent/Organizer`, never a raw account id comparison.
- `AccountUserAccessService` caches access per request keyed by `AuthUserService::getAuthenticatedTokenKey()` (the JWT string, or `api-key:{id}` for API keys); never key it on decoded payload claims (resources call `isPermitted()` hundreds of times per list).
- Frontend: 403s carrying `ACCESS_RESTRICTED`, `PERMISSION_REQUIRED` or `READ_ONLY_ROLE` must never send the user to login.
Loading
Loading