Skip to content
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

Open
srijan2607 opened this issue Jan 9, 2025 · 6 comments
Open

Several Post Bugs #2839

srijan2607 opened this issue Jan 9, 2025 · 6 comments
Labels
bug Something isn't working invalid This doesn't seem right no-issue-activity No issue activity

Comments

@srijan2607
Copy link

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.

@srijan2607 srijan2607 added the bug Something isn't working label Jan 9, 2025
@github-actions github-actions bot added invalid This doesn't seem right unapproved Unapproved for Pull Request labels Jan 9, 2025
Copy link

github-actions bot commented Jan 9, 2025

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.

@KUNAL01011
Copy link

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,
Kunal Kumar

@Cioppolo14
Copy link
Contributor

@srijan2607 Do you want to be assigned this issue?

@srijan2607
Copy link
Author

@Cioppolo14 Yes Ill Love to work on this I'm Already Done With The Local Setup

@Cioppolo14 Cioppolo14 removed the unapproved Unapproved for Pull Request label Jan 15, 2025
Copy link

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.

@github-actions github-actions bot added the no-issue-activity No issue activity label Jan 26, 2025
@palisadoes
Copy link
Contributor

unassiging inactivity

@palisadoes palisadoes changed the title Bug Report Several Post Bugs Jan 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working invalid This doesn't seem right no-issue-activity No issue activity
Projects
None yet
Development

No branches or pull requests

4 participants