🐛 Fixed missing hidden comment bodies for Admins when loading comment permalinks#28195
🐛 Fixed missing hidden comment bodies for Admins when loading comment permalinks#28195kevinansfield wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThis PR extends comment pagination to support an optional pluggable request API, enabling admin-specific comment browsing during permalink resolution. The implementation adds Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
apps/comments-ui/src/app.tsx (1)
186-188: 💤 Low valueConsider logging a warning for debugging purposes.
The empty catch block is intentional to preserve public API results on failure, but silent failures can make debugging harder. A warning would help diagnose issues without changing the fallback behavior.
🔧 Optional: Add debug logging
- } catch { - // Keep the public API permalink result when the admin API can't load this target. + } catch (e) { + // Keep the public API permalink result when the admin API can't load this target. + // eslint-disable-next-line no-console + console.warn('[Comments] Admin permalink resolution failed, using public API result:', e); }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/comments-ui/src/app.tsx` around lines 186 - 188, The empty catch swallowing errors makes silent failures hard to debug; in the catch block that preserves the public API permalink result (the try/catch around loading the admin API in apps/comments-ui/src/app.tsx), log a warning including the caught error and a short contextual message (e.g., use console.warn or the app's logger.warn) so behavior/fallback remains unchanged but failures are visible for debugging.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@apps/comments-ui/src/app.tsx`:
- Around line 186-188: The empty catch swallowing errors makes silent failures
hard to debug; in the catch block that preserves the public API permalink result
(the try/catch around loading the admin API in apps/comments-ui/src/app.tsx),
log a warning including the caught error and a short contextual message (e.g.,
use console.warn or the app's logger.warn) so behavior/fallback remains
unchanged but failures are visible for debugging.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: af622cb7-b43a-4e5d-b648-a38f32a3d77f
📒 Files selected for processing (2)
apps/comments-ui/src/app.tsxapps/comments-ui/test/e2e/permalink.test.ts
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b1ebb32765
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const adminComments = await adminApi.browse({page: 1, postId: options.postId, order: state.order, memberUuid}); | ||
| let adminPermalinkState: Partial<EditableAppContext> | null = null; | ||
|
|
||
| if (initialCommentId) { |
There was a problem hiding this comment.
Render auth frame for empty hidden-comment permalinks
This admin permalink recovery only runs after AuthFrame calls initAdminAuth, but the frame is still rendered only when state.comments.length > 0. For a permalink to a hidden comment on a post with no public comments, the member API returns an empty list and showMissingCommentNotice, so the auth frame is never mounted and this new adminApi.read path never executes; an authenticated admin still sees the missing-comment notice instead of the hidden comment.
Useful? React with 👍 / 👎.
ref https://linear.app/ghost/issue/BER-3686/hidden-comment-text-not-shown-when-loading-via-permalink Admins can land on hidden comments from moderation links, so permalink loading needs to resolve hidden targets through the admin API after authentication without replacing existing permalink state when that lookup fails.
75040b2 to
efb521f
Compare
ref https://linear.app/ghost/issue/BER-3686/hidden-comment-text-not-shown-when-loading-via-permalink
Summary