Skip to content

fix(console): offer logs for verified domains and drop the no-action promise - #15015

Merged
HarshMN2345 merged 4 commits into
mainfrom
fix/console-domain-logs
Oct 29, 2026
Merged

HarshMN2345 merged 4 commits into
mainfrom
fix/console-domain-logs

Conversation

@HarshMN2345

@HarshMN2345 HarshMN2345 commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

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.

  • Logs for verified rules: a verified rule with logs now offers Logs in the ⋯ row menu and the right-click menu, on the site, function and project domain screens. The inline "View logs" link stays on rules that are not verified, so healthy rows don't get a new link. A verified rule without logs (no certificate of its own yet) offers none.
  • One condition per action: canViewRuleLogs(rule) and canRetryRule(status) in lib/utils/proxy-domains.ts replace the conditions copied across the three screens and ProxyRuleContextMenu. Retry behavior is unchanged (created or unverified).
  • Live logs dialog: the dialog reads the rule from the list cache by $id, so it follows realtime updates while open, and falls back to the row it was opened from.
  • Copy: "SSL certificate is being issued. This usually takes a couple of minutes - no action needed on your end." is replaced in the logs and verify dialogs with "…This usually takes a few minutes. If the logs ask for a DNS record, add it where your domain's DNS is managed." A provider can wait on a DNS record that only the owner can add. Hebrew and Japanese dictionaries are updated.
  • Retry refresh: useVerifyDomain now refetches every ['proxy-rules'] list, as useDeleteDomain does. Its old keys did not match the site and function list keys.
  • Docs: the proxy docs describe logs and renewAt as the worker sets them. renewAt is when the certificate is next due for a check, not its expiry date.
  • types-baseline.json drops five TS2367 entries that the shared canRetryRule removes.

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: new tests/unit/proxy-rule-status.test.ts covers canViewRuleLogs for verified, verifying and unverified rules with empty, string and array logs, and canRetryRule for every status. 717 pass.
  • New mocked Playwright spec 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.
    • It checks that the badges are unchanged and that only the verifying row has the inline link.
    • It checks that the ⋯ menu offers Logs on every row except the verified one without logs, and that the dialog shows the warning.
    • Both tests pass locally against a dev server, and fail against the previous screens.
  • bun run check and bun run lint: no new errors against main.
  • bun run i18n:audit:he and bun run i18n:audit:ja: no issues.

Related PRs and Issues

  • None

Checklist

  • Have you read the Contributing Guidelines on issues?
  • If the PR includes a change to an API's metadata (desc, label, params, etc.), does it also include updated API specs and example docs? (N/A)

Generated by Claude Code

…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.
@luxor-code-review

luxor-code-review Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Review complete. 🟡 1 medium

💬 Inline comments (1)


This PR updates the console proxy-domain pages: rule status helpers in proxy-domains.ts now gate log viewing and retry actions per rule status, and the functions/sites/settings Domains pages consume those helpers for context menus and dialogs. A new e2e spec covers the mocked domain-logs flow, and a unit test locks the status predicates. SSL-verification copy was reworded across the base dictionary plus he/ja translations.

Files Change
apps/console/src/lib/utils/proxy-domains.ts, apps/console/tests/unit/proxy-rule-status.test.ts New/updated status predicates (canViewRuleLogs, canRetryRule) with unit coverage
apps/console/src/components/pages/projects/$projectId/{functions,sites,settings}/... Domains pages and ProxyRuleContextMenu/VerifyDomainContent/ViewLogs updated to use the new gating and copy
apps/console/src/lib/react-query/hooks/project-domains.ts Verify/delete hooks refetch ['proxy-rules'] queries on success
apps/console/src/lib/i18n/dictionaries/{he,ja}/project-misc.ts, apps/console/scripts/ja-translations/project-misc.ts Reworded SSL-message key in translations
apps/console/e2e/console.mocked.domain-logs.spec.ts New mocked e2e spec for domain log viewing
apps/console/src/content/docs/partners/proxy/index.markdoc, apps/console/types-baseline.json Docs update and type baseline refresh

Reviewed commit: 8f21d20

@appwrite

appwrite Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

New Console

Project ID: new-console

Sites (1)
Site Status Logs Preview QR
 New Console
new-console
Ready Ready View Logs Preview URL QR Code

Tip

Silent mode disables those chatty PR comments if you prefer peace and quiet

@ghost

ghost commented Oct 27, 2026 •

Copy link
Copy Markdown

🟢 Tier S · Ready to merge

The incremental change scopes verification refetches to the project without introducing a correctness issue in the user-visible flows.

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 useVerifyDomain so its refetch targets proxy-rule list queries for that project.

Verdict New comments Fixed Still open
✅ Approved 0 0 0
📂 Walkthrough · 25
File Change
apps/console/e2e/console.mocked.domain-logs.spec.ts, apps/console/tests/unit/proxy-rule-status.test.ts Adds mocked E2E and unit coverage for log visibility, retry eligibility, and the verified-rule log dialog.
apps/console/src/components/pages/projects/$projectId/functions/Domains.tsx, apps/console/src/components/pages/projects/$projectId/settings/Domains.tsx, apps/console/src/components/pages/projects/$projectId/sites/Domains.tsx, apps/console/src/components/pages/projects/$projectId/settings/domains/ProxyRuleContextMenu.tsx Uses shared rule conditions and offers logs for verified rules with logs in row and context menus.
apps/console/src/components/pages/projects/$projectId/functions/domains/AddDomainWizard.tsx, apps/console/src/components/pages/projects/$projectId/functions/domains/AddSmtpDomainWizard.tsx, apps/console/src/components/pages/projects/$projectId/functions/domains/VerifySmtpDomain.tsx, apps/console/src/components/pages/projects/$projectId/settings/domains/AddDomainWizard.tsx, apps/console/src/components/pages/projects/$projectId/sites/domains/AddDomainWizard.tsx Relies on the shared verification mutation's proxy-rule refresh instead of issuing redundant list refetches.
apps/console/src/components/pages/projects/$projectId/settings/domains/VerifyDomainContent.tsx, apps/console/src/components/pages/projects/$projectId/settings/domains/ViewLogs.tsx Updates certificate issuance guidance to explain that DNS records may need to be added by the domain owner.
apps/console/src/content/docs/partners/proxy/index.markdoc Documents proxy-rule logs and clarifies that renewAt is the next check time rather than certificate expiry.
apps/console/src/lib/i18n/dictionaries/he/project-misc.ts, apps/console/src/lib/i18n/dictionaries/ja/project-misc.ts, apps/console/scripts/ja-translations/project-misc.ts Updates translated verification guidance.
apps/console/src/lib/react-query/hooks/project-domains.ts Refreshes proxy-rule lists for the verifying project after success, now filtering cached list queries by project ID.
apps/console/src/lib/utils/proxy-domains.ts Defines shared predicates for log visibility and retry eligibility.
apps/console/types-baseline.json Removes type-check baseline entries for status comparisons replaced by the shared retry predicate.
apps/console/e2e/console.mocked.domain-logs.spec.ts Adds mocked E2E coverage for log visibility and dialogs on project and site domain screens.
apps/console/src/components/pages/projects/$projectId/functions/Domains.tsx Uses shared log/retry conditions and resolves the displayed log rule from the list.
apps/console/src/components/pages/projects/$projectId/functions/domains/AddDomainWizard.tsx Uses the shared verification refresh behavior instead of issuing redundant list refetches.
apps/console/src/components/pages/projects/$projectId/functions/domains/AddSmtpDomainWizard.tsx Uses the shared verification refresh behavior instead of issuing a redundant list refetch.
apps/console/src/components/pages/projects/$projectId/functions/domains/VerifySmtpDomain.tsx Removes the extra list refetch after verification, relying on the shared mutation hook.
apps/console/src/components/pages/projects/$projectId/settings/Domains.tsx Uses shared log/retry conditions and resolves the displayed log rule from the list.
apps/console/src/components/pages/projects/$projectId/settings/domains/AddDomainWizard.tsx Uses the shared verification refresh behavior instead of issuing redundant list refetches.
apps/console/src/components/pages/projects/$projectId/settings/domains/ProxyRuleContextMenu.tsx Adds the log action for verified rules that have logs.
apps/console/src/components/pages/projects/$projectId/settings/domains/VerifyDomainContent.tsx Updates guidance about certificate issuance and DNS records.
apps/console/src/components/pages/projects/$projectId/settings/domains/ViewLogs.tsx Updates the certificate-issuance guidance in the logs dialog.
apps/console/src/components/pages/projects/$projectId/sites/Domains.tsx Uses shared log/retry conditions and resolves the displayed log rule from the list.
apps/console/src/components/pages/projects/$projectId/sites/domains/AddDomainWizard.tsx Uses the shared verification refresh behavior instead of issuing redundant list refetches.
apps/console/src/lib/i18n/dictionaries/he/project-misc.ts Updates Hebrew verification guidance.
apps/console/src/lib/i18n/dictionaries/ja/project-misc.ts Updates Japanese verification guidance.
apps/console/scripts/ja-translations/project-misc.ts Updates Japanese translation source for verification guidance.
apps/console/tests/unit/proxy-rule-status.test.ts Tests the shared log-visibility and retry conditions.

Merged main (0f1e945); no changes to this PR's code since bcde2d5 · Details · Comment @hansi-codes review to re-run, or mention @hansi-codes with a question.

@ghost ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Tier A · Looks good to merge. Summary

@luxor-code-review luxor-code-review Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Console domain-logs UX updates (rule status gating, log viewing, i18n) with a query-refetch regression in the verify/delete hooks.

Key findings

Comment on lines +232 to 236
onSuccess: async () => {
await queryClient.refetchQueries({
queryKey: ['proxy-rules'],
})
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.

HarshMN2345 and others added 3 commits October 27, 2026 14:18
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.
@HarshMN2345
HarshMN2345 merged commit 6ba6a0e into main Oct 29, 2026
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant