-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix: remove duplicate InterfacePostCard definition #6356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
fix: remove duplicate InterfacePostCard definition #6356
Conversation
|
No significant changes currently retry |
Our Pull Request Approval ProcessThis PR will be reviewed according to our: Your PR may be automatically closed if:
Thanks for contributing! |
WalkthroughThis PR removes a duplicate Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro ⛔ Files ignored due to path filters (12)
📒 Files selected for processing (2)
🧰 Additional context used📓 Path-based instructions (1)**/*.{ts,tsx}📄 CodeRabbit inference engine (Custom checks)
Files:
🧠 Learnings (3)📚 Learning: 2026-01-06T21:27:50.880ZApplied to files:
📚 Learning: 2026-01-07T14:21:19.711ZApplied to files:
📚 Learning: 2025-12-14T21:12:41.707ZApplied to files:
🔇 Additional comments (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/types/Post/interface.ts (1)
9-23: Fix type incompatibility:InterfacePostEdge.nodeshould bePostNode, notInterfacePost.Line 21 changes
InterfacePostEdge.nodetoInterfacePost, but the GraphQL query returns data matching thePostNodetype structure. This creates a breaking type mismatch:
- GraphQL response includes:
commentCount,upVotesCount,downVotesCount,hasUserVoted(all required byPostNode)InterfacePostlacks these properties, causing type incompatibility at line 169 insrc/screens/UserPortal/Posts/Posts.tsxwhereedge.nodeis assigned to state typed asPostNode[]
InterfacePostEdge.nodeshould be typed asPostNodeto match the actual GraphQL schema, or define a union type if supporting multiple node shapes.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
⛔ Files ignored due to path filters (12)
docs/docs/auto-docs/types/Post/interface/interfaces/InterfaceAttachment.mdis excluded by!**/docs/docs/**docs/docs/auto-docs/types/Post/interface/interfaces/InterfaceCreator.mdis excluded by!**/docs/docs/**docs/docs/auto-docs/types/Post/interface/interfaces/InterfaceMutationCreatePostInput.mdis excluded by!**/docs/docs/**docs/docs/auto-docs/types/Post/interface/interfaces/InterfaceOrganization.mdis excluded by!**/docs/docs/**docs/docs/auto-docs/types/Post/interface/interfaces/InterfaceOrganizationPostListData.mdis excluded by!**/docs/docs/**docs/docs/auto-docs/types/Post/interface/interfaces/InterfacePageInfo.mdis excluded by!**/docs/docs/**docs/docs/auto-docs/types/Post/interface/interfaces/InterfacePost.mdis excluded by!**/docs/docs/**docs/docs/auto-docs/types/Post/interface/interfaces/InterfacePostCard.mdis excluded by!**/docs/docs/**docs/docs/auto-docs/types/Post/interface/interfaces/InterfacePostConnection.mdis excluded by!**/docs/docs/**docs/docs/auto-docs/types/Post/interface/interfaces/InterfacePostCreator.mdis excluded by!**/docs/docs/**docs/docs/auto-docs/types/Post/interface/interfaces/InterfacePostEdge.mdis excluded by!**/docs/docs/**docs/docs/auto-docs/types/Post/interface/interfaces/InterfacePostNode.mdis excluded by!**/docs/docs/**
📒 Files selected for processing (2)
src/types/Post/interface.tssrc/vite-env.d.ts
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (Custom checks)
Zero TypeScript errors: Run pnpm run typecheck and must pass without errors or warnings
Files:
src/vite-env.d.tssrc/types/Post/interface.ts
🧠 Learnings (3)
📚 Learning: 2026-01-06T21:27:50.880Z
Learnt from: Jashan32
Repo: PalisadoesFoundation/talawa-admin PR: 6222
File: src/utils/userUpdateUtils.ts:22-22
Timestamp: 2026-01-06T21:27:50.880Z
Learning: In the Talawa Admin codebase, the i18n extraction tool can misclassify TypeScript generic syntax (e.g., (obj: T): Partial) as translatable content. Suppress these false positives by adding a // i18n-ignore-next-line comment directly above the line with the type declaration or generic function signature. Apply this only to TS code where misclassification is confirmed; avoid blanket suppression.
Applied to files:
src/vite-env.d.tssrc/types/Post/interface.ts
📚 Learning: 2026-01-07T14:21:19.711Z
Learnt from: cotishq
Repo: PalisadoesFoundation/talawa-admin PR: 6198
File: src/setup/setup.ts:123-124
Timestamp: 2026-01-07T14:21:19.711Z
Learning: Use TSDoc (eslint-plugin-tsdoc) instead of JSDoc. Do not wrap type names in curly braces in throws and returns. Write as "throws Error" and "returns Promise<void>" (no braces). Curly-brace usage causes tsdoc-malformed-inline-tag and tsdoc-escape-right-brace lint errors. Apply this rule to all TypeScript source files (e.g., src/**/*.ts) to ensure consistency.
Applied to files:
src/vite-env.d.tssrc/types/Post/interface.ts
📚 Learning: 2025-12-14T21:12:41.707Z
Learnt from: Jashan32
Repo: PalisadoesFoundation/talawa-admin PR: 5009
File: src/types/Post/interface.ts:106-123
Timestamp: 2025-12-14T21:12:41.707Z
Learning: Consolidate all post-related TypeScript interfaces (e.g., ICreatePostModalProps, InterfacePinnedPostsLayoutProps, InterfacePinnedPostCardProps, InterfacePost, InterfacePostEdge) in src/types/Post/interface.ts and export them for reuse across post directories; follow a functionality-based organization pattern consistent with Event and User types, and maintain consistent naming and export style.
Applied to files:
src/types/Post/interface.ts
🔇 Additional comments (3)
src/types/Post/interface.ts (2)
1-1: Clear documentation of the interface removal.The comment effectively communicates the removal of
InterfacePostCardand directs developers to the centralized definition insrc/utils/interfaces.ts, which aligns perfectly with the PR objectives.
73-83: Runpnpm run typecheckin your development environment to confirm zero TypeScript errors.Per the coding guidelines for TypeScript files, verify that
pnpm run typecheckpasses without errors or warnings. The interface definition should be checked against all referenced types (InterfaceCreator, InterfaceAttachment) to ensure proper type safety.src/vite-env.d.ts (1)
5-5: This ambient module declaration should be in a separate PR.The
declare module 'react-multi-carousel';declaration is necessary—react-multi-carouselis imported and used insrc/screens/UserPortal/Posts/Posts.tsxandsrc/screens/OrgPost/PinnedPostsStory.tsx. However, this change is unrelated to the PR's stated objective of removing duplicateInterfacePostCarddefinitions. It addresses a separate typecheck issue and should be split into its own commit or PR for clarity and independent review.
|
@coderabbitai could you assist me in identifying the specific lines causing the merge conflicts? |
|
@palisadoes I have checked the files mentioned but I haven't found any conflicts there ? |

What kind of change does this PR introduce?
Resolve the type errors occurring in PostCard.spec.tsx and conflicting interface definitions.
Issue Number:
Fixes #6243
Snapshots/Videos:
If relevant, did you update the documentation?
Summary
This PR resolves build-breaking type errors in the PostCard component and its tests by unifying conflicting interface definitions. Eliminates the partial and conflicting InterfacePostCard definition from src/types/Post/interface.ts
Does this PR introduce a breaking change?
No
Checklist
CodeRabbit AI Review
Test Coverage
Other information
Have you read the contributing guide?
Yes
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.