-
-
Notifications
You must be signed in to change notification settings - Fork 997
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
Several Post Bugs #2839
Comments
Congratulations on making your first Issue! 🎊 If you haven't already, check out our Contributing Guidelines and Issue Reporting Guidelines to ensure that you are following our guidelines for contributing and making issues. |
Hi @srijan2607 , This is my first time contributing to your repository, and I’m excited to get started. I came across the issue regarding post creation logic and would like to help resolve it. Could you please guide me on how I can reproduce this issue on my local setup? I would also like to know if there are any specific steps or guidelines I should follow to verify the problem on the frontend. Once I confirm the issue, I’ll proceed with implementing a solution and raising a pull request. Looking forward to your guidance! Thank you, |
@srijan2607 Do you want to be assigned this issue? |
@Cioppolo14 Yes Ill Love to work on this I'm Already Done With The Local Setup |
This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue. |
unassiging inactivity |
There are several issues with the current post creation logic, including improper validation of title and text, missing checks for file upload handling, incomplete permission checks for pinning posts, and inconsistencies in error handling and caching.
To Reproduce
Steps to reproduce the behavior:
1. Make a post request with invalid title length (more than 256 characters).
2. Make a post request without including a title but with pinned: true.
3. Try to upload a file with a post creation request without proper validation for file handling.
4. Try creating a post when the user is not a member of the organization but isn’t properly handled.
5. Try pinning a post when the user does not have authorization to do so.
Expected behavior
• Title should be properly validated for a maximum length of 256 characters.
• If pinned: true, title must be provided.
• File uploads should be handled correctly with proper validation.
• Error messages should be specific and provide actionable feedback.
• The user must be a member of the organization to create a post unless they are a super admin.
• Pinning posts should only be allowed for users with the proper admin privileges or super admin rights.
Actual behavior
• Title and text validation do not properly enforce the maximum length.
• Missing validation for the case where pinned: true but no title is provided.
• File upload logic was incomplete, leading to potential errors or failed uploads.
• Users who are not members of the organization can still create posts.
• Users without proper permissions can attempt to pin posts.
• Errors are not clearly defined, and some error messages are generic or unhelpful.
Additional details
The bug was fixed by:
• Adding proper validation checks for title and text lengths.
• Implementing a validation rule to ensure that the title is provided when pinned: true.
• Refactoring file upload handling to improve error handling and validation.
• Ensuring users are part of the organization (or super admins) before allowing post creation.
• Adding proper authorization checks for pinning posts.
The text was updated successfully, but these errors were encountered: