Repository navigation
PageMode Demo (Frontend + Django Backend + MongoDB integration) - #43
Conversation
0c3f0d0 to
e1f4b7b
Compare
| return JsonResponse({ | ||
| 'success': True, | ||
| 'statusCode': 200 | ||
| }, status=200) |
There was a problem hiding this comment.
Delete operations ignore result and report false success
Low Severity
The delete_comment and delete_reaction handlers capture the return value from store.delete_comment() and store.delete_reaction() in a deleted variable but never use it. These store functions return False when no document was found to delete, but the handlers always return success: True regardless. This misleads clients into thinking deletions succeeded when the target item didn't exist.
Additional Locations (1)
| try: | ||
| data = json.loads(request.body) | ||
| user_ids = data.get('userIds', []) | ||
| users = db_get_users(user_ids) |
There was a problem hiding this comment.
Missing type validation allows incorrect MongoDB query behavior
Medium Severity
The get_users handler retrieves userIds from the request and passes it directly to db_get_users without validating it's actually a list. If a client sends {"userIds": "abc"} (a string instead of an array), MongoDB's $in operator in store.get_users will iterate over the string's characters, matching documents where userId equals 'a', 'b', or 'c'. This returns incorrect results and could expose unintended user data.
Pull Request
Description
Type of Change
Monorepo Structure Checklist
If adding a new demo, ensure you've followed the 5-level structure:
apps/<framework>/<document>/<type>/<implementation>/<library-or-solution>/<demo>/package.jsonwith scoped name:@apps/<framework>-<document>-<library-or-solution>-<demo>pnpm --filter <package-name> buildpnpm --filter <package-name> devDeployment Checklist
If this demo should be deployed:
Testing
pnpm -w install && pnpm -w buildDocumentation
master-sample-app(if applicable)Related Issues
Screenshots/Videos
Additional Context
For Reviewers
Demo Location
Path:
apps/<framework>/<document>/<type>/<implementation>/<library-or-solution>/<demo>/Package name:
@apps/<...>How to Test
Structure Verification
The demo follows the 5-level hierarchy:
Documentation: See README_MONOREPO.md and docs/structure.md for more details on the monorepo structure.
Note
Introduces a full-stack self-hosted demo for Page Mode Forms combining Next.js (React) with a Django backend using MongoDB.
apps/react/self-hosting/forms/page-mode-demowith Velt integration, custom UI, and Tailwind setupapp/api/velt/backend) exposingcomments,reactions,users,attachments, andtokenendpoints; Next.jstokenroute addedVeltDataProviders.ts) and app-level auth/document initializationbackend/configandbackend/api/handlers) with updated imports and tests location.env.local.example, backend.env.example,package.jsondev:all/dev:backend, CSP headers, Vercel config)Written by Cursor Bugbot for commit bbf30b0. This will update automatically on new commits. Configure here.