Repository navigation
fix: domain setup, Cloudflare API paging and errors, login and auth cleanup - #322
Merged
Merged
Conversation
Ids: bugs-login-email-case Emails are stored lowercase, so signing in with "Alice@Example.com" (for example a keyboard that capitalises the first letter) returned invalid credentials while password reset for the same text worked. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Ids: bugs-domains-check-no-cf-creds Without Cloudflare credentials (or with Skip DNS ticked) the domain check answered 502 "CF_TOKEN or CF_API_KEY is not configured" and the domain could not be added, although the server adds it as a manual zone. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Ids: bugs-mx-delete-no-restore When an operator confirmed replacing another provider's MX records and a later step failed, the old MX was already deleted and the domain had no MX. - Resend/SES receiving: the new MX is created first and the old ones are deleted afterwards, so a rejected create deletes nothing. - Cloudflare Email Routing and the sending subdomain: provisioning needs the old records removed first, so they are deleted and then recreated if the next step fails. Any Cloudflare MX created by a half-finished routing setup is removed first. If the records cannot be recreated the error says which ones, instead of only logging it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Ids: bugs-hostname-validation "example.com." was stored with the trailing dot and treated as a subdomain of its own zone, "münchen.de" failed with "Zone not found" because zone names are punycode, and values such as "https://example.com" or "a b.com" were stored as given. Hostnames now go through one normalizeHostname (trim, lowercase, strip trailing dot, punycode) and must look like a domain. IP addresses, including forms the URL parser rewrites such as "0x7f.1", are rejected. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Ids: bugs-mailbox-localpart-validation POST /api/mailboxes accepted any text, so "bob smith" or "a@b" created a mailbox that could never receive mail. The schema now uses the same character check as the account and alias schemas. Collisions between names that differ only by dots or +tag are not changed here. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Ids: bugs-add-domain-mx-replace-ignored Adding a domain with Cloudflare sending and another receiving provider answered 409 MX conflict again after the user confirmed, because the confirmation was dropped whenever receiving was not Cloudflare. The routing step is already skipped in that case, so the flag only affects the sending subdomain. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…a timeout Ids: bugs-cfrequest-non-json During Cloudflare incidents the API answers with an HTML 5xx page; the request helper threw a JSON SyntaxError instead of CloudflareApiError, so the status-based handling never saw it. A hung connection also waited forever. Requests now time out after 30 s and a body that is not JSON is raised as a CloudflareApiError carrying the HTTP status. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Ids: bugs-cf-rules-pagination The rules list was read without paging, so in a zone with more rules than one page, rules past the first page were invisible: creating a mailbox could try to add a duplicate rule, deleting a mailbox or domain left the Worker route behind. The list now requests per_page=50 and follows result_info.total_pages. If the list is longer than the page cap it throws instead of returning a partial list. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Ids: perf-routing-rule-list-per-address Adding a domain or enabling Cloudflare receiving re-fetched the zone's routing rules for every address of every mailbox at the same time, so a user with many mailboxes issued dozens of identical requests and could hit request limits, leaving some mailboxes without a route. The listing is now shared per zone within one operation. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Ids: bugs-apikey-replica-read (read from primary) Session lookup already reads the primary database so it is not affected by replica lag; API key and MCP key lookups used the replica-capable session. They now read the key row and its user from the primary like session lookup. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…daily Ids: db-expired-auth-rows-never-purged Sessions not ended by a logout, abandoned MFA logins and reset requests left rows behind forever, growing the tables and every backup. The daily scheduled run (Worker cron and Node scheduler) now deletes rows whose expiry has passed, including expired passkey enrolment links. Deletes run in batches of 90 ids with a cap of 50 batches per table per run, so a first run over a large backlog stays bounded and continues the next day. Deleting a session also removes its push subscription, as logout does. No schema change. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…managers Ids: accounts-list-contacts (permission consistency) The accounts list and detail responses included each account's recovery and forwarding address for any admin, while changing accounts requires the manage-users permission. Those fields are now returned only to admins who can manage users; the list itself is unchanged so account pickers keep working. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Ids: star-read-only (permission consistency) The star toggle only checked read access, although the flag is stored on the shared message and JMAP already requires a permission above read-only to change it. Read-only delegates now get a 403, matching JMAP, and the message list shows an error when the toggle fails. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
# Conflicts: # src/components/messages/message-folder-page.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes for adding domains, Cloudflare API handling and login, plus two small permission-consistency changes.
Domains and Cloudflare
normalizeHostname(trim, lowercase, strip trailing dot, punycode), and the value must look like a domain.example.com.,münchen.deandhttps://example.comnow behave; IP addresses are rejected.POST /api/mailboxesuses the same character check as accounts and aliases, sobob smithora@bcan't be created. Dot and+tagcollisions are not changed here.CloudflareApiErrorwith its status instead of a JSONSyntaxError, and requests time out after 30 s.per_page=50,total_pages), so rules past page 1 are no longer missed when creating or deleting mailboxes. It is fetched once per zone per operation instead of once per address.Auth
Permission consistency
Rebased on current
main: tsc is clean, lint has 0 errors, andnode --testpasses 709 of 711 (2 skipped).🤖 Generated with Claude Code