Skip to content

Add setting to disable direct messages - #147

Open
PastaPastaPasta wants to merge 2 commits into
masterfrom
claude/disable-dms-setting-B2zNc
Open

Add setting to disable direct messages#147
PastaPastaPasta wants to merge 2 commits into
masterfrom
claude/disable-dms-setting-B2zNc

Conversation

@PastaPastaPasta

Copy link
Copy Markdown
Owner
  • Add allowDirectMessages setting to Zustand store (enabled by default)
  • Add toggle in Privacy & Security settings to turn DMs on/off
  • Show warning message when DMs are disabled in settings
  • Show disabled state on messages page when DMs are turned off
  • Link to settings from disabled state to easily re-enable

- Add allowDirectMessages setting to Zustand store (enabled by default)
- Add toggle in Privacy & Security settings to turn DMs on/off
- Show warning message when DMs are disabled in settings
- Show disabled state on messages page when DMs are turned off
- Link to settings from disabled state to easily re-enable
@coderabbitai

coderabbitai Bot commented Jan 18, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@PastaPastaPasta has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 11 minutes and 28 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 97c3208 and afe1db5.

📒 Files selected for processing (3)
  • app/messages/page.tsx
  • app/settings/page.tsx
  • lib/store.ts

Comment @coderabbitai help to get the list of available commands and usage tips.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jan 18, 2026

Copy link
Copy Markdown

Deploying yappr with  Cloudflare Pages  Cloudflare Pages

Latest commit: afe1db5
Status: ✅  Deploy successful!
Preview URL: https://9e98aa75.yappr.pages.dev
Branch Preview URL: https://claude-disable-dms-setting-b.yappr.pages.dev

View logs

@thepastaclaw

thepastaclaw commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

🕓 Ready for review — 64 ahead in queue (commit afe1db5)
Queue position: 65/74 · 3 reviews active
ETA: start ~08:36 UTC · complete ~09:12 UTC (median 36m across 30 recent reviews; 3 slots)
Queued 40m ago · Last checked: 2026-07-21 19:20 UTC

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Preliminary review — Codex only

The toggle persists and renders the disabled state, but it does not enforce the advertised direct-message opt-out. Senders can still create messages for the identity, while the disabled recipient page continues querying and decrypting messages behind the guard.

Validated blockers were found in the Codex precheck. Sonnet is deferred until a fresh Codex revalidation clears the blocker gate.

Review provenance

  • Codex reviewers: gpt-5.6-sol — general (completed)
  • Verifier: gpt-5.6-sol — verifier
  • Sonnet: not run (deferred by blocker gate)

🔴 2 blocking

🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.

In `lib/store.ts`:
- [BLOCKING] lib/store.ts:175-176: The local-only setting cannot prevent other users from sending DMs
  The Privacy & Security toggle says “Allow other users to send you direct messages,” but this value exists only in the current browser's persisted `yappr-settings` store. Nothing publishes an identity-scoped preference that another client can query: profile pages still expose the Message action, and `DirectMessageService.sendMessage` creates the recipient's `conversationInvite` and `directMessage` without checking any opt-out. Disabling the toggle therefore has no effect on another user's client, which can continue writing messages for this identity. Store the preference somewhere sender clients can query and enforce it in every send/start-conversation path, or change the feature and its copy to accurately describe a local inbox-access control.

In `app/messages/page.tsx`:
- [BLOCKING] app/messages/page.tsx:544-545: The disabled return occurs after message-loading effects
  The disabled-state guard does not stop any hook declared above it. Opening `/messages` with DMs disabled still runs `getConversations`, which queries each conversation's messages and decrypts its latest message. A `startConversation` parameter can also select a conversation and trigger full message loading, read-receipt writes, and polling because those effects do not depend on `allowDirectMessages`; polling already active when the toggle is disabled also remains mounted. This contradicts the page's statement that messages must be enabled to receive them. Gate the conversation, auto-start, message-loading, read-receipt, search, and polling effects on the setting, or mount the messaging implementation only while DMs are enabled.

Comment thread lib/store.ts
Comment on lines +175 to +176
allowDirectMessages: true, // Enabled by default
setAllowDirectMessages: (enabled) => set({ allowDirectMessages: enabled }),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Blocking: The local-only setting cannot prevent other users from sending DMs

The Privacy & Security toggle says “Allow other users to send you direct messages,” but this value exists only in the current browser's persisted yappr-settings store. Nothing publishes an identity-scoped preference that another client can query: profile pages still expose the Message action, and DirectMessageService.sendMessage creates the recipient's conversationInvite and directMessage without checking any opt-out. Disabling the toggle therefore has no effect on another user's client, which can continue writing messages for this identity. Store the preference somewhere sender clients can query and enforce it in every send/start-conversation path, or change the feature and its copy to accurately describe a local inbox-access control.

source: ['codex']

Comment thread app/messages/page.tsx
Comment on lines +544 to +545
// Show disabled state when DMs are turned off
if (!allowDirectMessages) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Blocking: The disabled return occurs after message-loading effects

The disabled-state guard does not stop any hook declared above it. Opening /messages with DMs disabled still runs getConversations, which queries each conversation's messages and decrypts its latest message. A startConversation parameter can also select a conversation and trigger full message loading, read-receipt writes, and polling because those effects do not depend on allowDirectMessages; polling already active when the toggle is disabled also remains mounted. This contradicts the page's statement that messages must be enabled to receive them. Gate the conversation, auto-start, message-loading, read-receipt, search, and polling effects on the setting, or mount the messaging implementation only while DMs are enabled.

source: ['codex']

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants