Skip to content

Conversation

intchrkl
Copy link
Contributor

@intchrkl intchrkl commented Feb 24, 2025

Feature: Implementing Private Posting Feature [US03]

Summary:
This PR addresses #16 and attempts to add a field to store a flag indicating whether a post has been toggled as private to just the student and instructors or not. Eventually, this will be connected to the checkboxes implemented to toggle this flag in the frontend.


Changes Made:

Adding field to store private post flag in the backend:

  • src/controllers/admin/dashboard.js
  • src/middleware/user.js
  • src/posts/create.js
  • src/posts/summary.js
  • test/posts.js

Adding field to store private post flag in the schema:

  • public/openapi/components/schemas/PostObject.yaml
  • public/openapi/components/schemas/TopicObject.yaml

Challenges Faced:
The implementation of the backend involved adding a field to store the isPrivate field which is a boolean flag to indicate whether a post is private to just the student and instructors. However, this backend implementation fell through and was not completed despite best efforts to do so. When trying to run NodeBB, there were many problems and troubleshooting the setup proved to be more challenging than expected. The main issue was getting NodeBB to run locally, as there were repeated difficulties with configuring the database and test_database properly. Additionally, the backend implementation turned out to be more complex than initially estimated because the private post feature is deeply interconnected with multiple parts of the codebase. Making changes to one file often introduced errors in other dependent files, leading to numerous failed test cases. These cascading issues made debugging and implementing the feature far more time-consuming than anticipated, ultimately causing the backend implementation to stall.


Testing:
This feature can be tested using the tests added to the unit tests which can be run using npm run test

@bnolinn bnolinn added the enhancement New feature or request label Feb 26, 2025
@bnolinn bnolinn added this to the Sprint 2 milestone Feb 26, 2025
@intchrkl intchrkl changed the title [WIP] Anonymous post feature [WIP] Private post feature backend Feb 27, 2025
@intchrkl intchrkl changed the title [WIP] Private post feature backend [WIP] Backend Implementation for Private Posting Feature Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants