Repository navigation
fix(console): offer logs for verified domains and drop the no-action promise - #15015
Conversation
…promise The certificates worker writes a verified rule's logs on every check, including a warning when the certificate expires soon and has not been renewed. Every domain screen hid "View logs" for verified rules, so that reason was unreachable. - Verified rules with logs now offer Logs in the row menu and the right-click menu. The inline link stays on rules that are not verified. - canViewRuleLogs and canRetryRule replace the copied conditions on the site, function and project domain screens and the context menu. - The logs dialog reads the cached rule, so it follows realtime updates. - "No action needed on your end" is replaced in the logs and verify dialogs: a certificate can wait on a DNS record from the owner. - Retrying verification refetches every proxy rule list, as deleting a domain does. - The proxy docs describe logs and renewAt as they behave: renewAt is the next check, not the expiry date.
|
Review complete. 🟡 1 medium 💬 Inline comments (1)
This PR updates the console proxy-domain pages: rule status helpers in
Reviewed commit: 8f21d20 |
New ConsoleProject ID: Tip Silent mode disables those chatty PR comments if you prefer peace and quiet |
🟢 Tier S · Ready to merge
The pull request exposes logs for verified proxy rules that have logs across the project, site, and function domain screens, while keeping inline log links for non-verified rules. It adds shared visibility and retry predicates, resolves log dialogs from live list data, updates verification guidance, docs, translations, and unit/E2E coverage, and aligns verification refresh behavior across proxy-rule lists. The latest change scopes that verification refresh to cached lists belonging to the current project. Latest changes: The newest commit adds a project-ID predicate to
📂 Walkthrough · 25
Merged |
There was a problem hiding this comment.
Console domain-logs UX updates (rule status gating, log viewing, i18n) with a query-refetch regression in the verify/delete hooks.
Key findings
- 🟡 Awaited global
refetchQueriesin verify/deleteonSuccess— project-domains.ts:232
| onSuccess: async () => { | ||
| await queryClient.refetchQueries({ | ||
| queryKey: ['proxy-rules'], | ||
| }) | ||
| }, |
There was a problem hiding this comment.
🟡 bug · medium
Awaited global refetchQueries in verify/delete onSuccess
The onSuccess handlers for useVerifyDomain and useDeleteDomain now await queryClient.refetchQueries({ queryKey: ['proxy-rules'] }), replacing the previous scoped, non-awaited invalidateQueries calls (apps/console/src/lib/react-query/hooks/project-domains.ts:232-236). The root-level key refetches every active proxy-rules query across all cached projects and regions, not just the affected project's list. Because callers await mutateAsync, the verify/retry dialog stays pending until unrelated refetches settle, and a failing refetch surfaces through the caller's catch path even though the server-side verification succeeded.
📋 Prompt for AI Agents
In apps/console/src/lib/react-query/hooks/project-domains.ts, in the onSuccess of useVerifyDomain (around line 232) and useDeleteDomain (around line 264), replace await queryClient.refetchQueries({ queryKey: ['proxy-rules'] }) with non-awaited queryClient.invalidateQueries({ queryKey: ['proxy-rules', 'project', projectId] }) plus queryClient.invalidateQueries({ queryKey: Dependencies.DOMAINS }), matching the original behavior of useCreateDomain. This scopes the refresh to the affected project, stops blocking mutateAsync callers on unrelated cross-project refetches, and prevents refetch errors from being reported as verification failures.
useVerifyDomain now refetches every proxy rule list before mutateAsync resolves, so the add-domain wizards and the SMTP verify dialog fetched the same list twice after verifying.

What does this PR do?
The certificates worker writes a verified rule's logs on every check, including a warning when the certificate expires soon and has not been renewed yet. Every domain screen hid "View logs" for verified rules, so that reason could not be reached from the Console.
canViewRuleLogs(rule)andcanRetryRule(status)inlib/utils/proxy-domains.tsreplace the conditions copied across the three screens andProxyRuleContextMenu. Retry behavior is unchanged (createdorunverified).$id, so it follows realtime updates while open, and falls back to the row it was opened from.useVerifyDomainnow refetches every['proxy-rules']list, asuseDeleteDomaindoes. Its old keys did not match the site and function list keys.logsandrenewAtas the worker sets them.renewAtis when the certificate is next due for a check, not its expiry date.types-baseline.jsondrops five TS2367 entries that the sharedcanRetryRuleremoves.This makes the reason reachable; it does not yet flag an at-risk certificate in the list. A badge for that needs the certificate's expiry and renewal state from the API, which comes in a separate change.
Test Plan
bun run test:unit: newtests/unit/proxy-rule-status.test.tscoverscanViewRuleLogsfor verified, verifying and unverified rules with empty, string and array logs, andcanRetryRulefor every status. 717 pass.e2e/console.mocked.domain-logs.spec.ts, on project settings → Domains and a site's Domains tab, with four rules: verified with a warning, verified and healthy, verified with no logs, and verifying with no logs.bun run checkandbun run lint: no new errors againstmain.bun run i18n:audit:heandbun run i18n:audit:ja: no issues.Related PRs and Issues
Checklist
Generated by Claude Code