Skip to content

fix(presence): respect ALLOW_ANON_PRESENCE and enable presence tracking for sessions - #84

Open
Aaravanand00 wants to merge 1 commit into
alphaonelabs:mainfrom
Aaravanand00:fix/presence-do-auth-tests
Open

Aaravanand00 wants to merge 1 commit into
alphaonelabs:mainfrom
Aaravanand00:fix/presence-do-auth-tests

Conversation

@Aaravanand00

Copy link
Copy Markdown

Description

This PR resolves the failure in PresenceDO.on_fetch where interactive presence updates failed and anonymous sessions were rejected even when ALLOW_ANON_PRESENCE was configured.

Root Cause & Changes Made

  1. Configurable Anonymous Presence:
    • PresenceDO.on_fetch now reads and respects ALLOW_ANON_PRESENCE from the environment (self.env).
    • If anonymous presence is disabled (ALLOW_ANON_PRESENCE=false) and no valid JWT is provided, connections are properly rejected with 401 {"error": "Authentication required"}.
  2. Presence State Assignment:
    • For valid sessions (either authenticated users or permitted anonymous participants), can_interact is set to True, ensuring the user's presence state is stored in self.presence[user_id] and broadcasted on coordinate/emoji/hand updates.

Checklist

  • Did you run the pre-commit? (Code compiled with zero syntax/type errors)
  • Did you test the change? (All 35 tests in tests/test_presence_do.py pass cleanly in 0.52s)

@coderabbitai

coderabbitai Bot commented Oct 2, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Repository: alphaonelabs/coderabbit/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 64d1fc2a-e0ef-43c9-8476-b538e3866d30

  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

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.

1 participant