-
Notifications
You must be signed in to change notification settings - Fork 154
fix(video): Restore polling functionality and fix anonymous room link redirects #1448
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
base: enext
Are you sure you want to change the base?
Conversation
Reviewer's GuideRestores default video/webapp feature flags for legacy events, adds short-token anonymous invite redirect routing to the standalone video SPA, and updates Vue Router integration for compatibility with Vue Router 4. Sequence diagram for anonymous invite short-link redirect to standalone video SPAsequenceDiagram
actor AnonymousUser
participant Browser
participant DjangoURLConf
participant AnonymousInviteRedirectView
participant AnonymousInviteModel
participant VideoSPA
AnonymousUser->>Browser: Open short invite URL /eGHhXr/
Browser->>DjangoURLConf: HTTP GET /eGHhXr/
DjangoURLConf->>AnonymousInviteRedirectView: Dispatch with token=eGHhXr
AnonymousInviteRedirectView->>AnonymousInviteModel: get(short_token=token, expires__gte=now())
AnonymousInviteModel-->>AnonymousInviteRedirectView: AnonymousInvite(event, room, short_token)
AnonymousInviteRedirectView->>AnonymousInviteRedirectView: Build redirect_url
AnonymousInviteRedirectView-->>Browser: HTTP 302 Redirect /{organizer}/{event}/video/standalone/{room_id}/anonymous#invite={token}
Browser->>VideoSPA: GET /{organizer}/{event}/video/standalone/{room_id}/anonymous#invite={token}
VideoSPA-->>Browser: Serve SPA index.html
Browser->>VideoSPA: Execute main.js init
VideoSPA->>VideoSPA: router.replace(relativePath)
VideoSPA->>VideoSPA: route = router.resolve(relativePath)
VideoSPA->>VideoSPA: anonymousRoomId from route.params.roomId
VideoSPA-->>Browser: Mount app with anonymousRoomId
Entity relationship diagram for AnonymousInvite and related event/video entitieserDiagram
ORGANIZER {
int id
string slug
string name
}
EVENT {
int id
string slug
string locale
json feature_flags
}
ROOM {
int id
string name
}
ANONYMOUSINVITE {
int id
string short_token
datetime expires
int event_id
int room_id
}
ORGANIZER ||--o{ EVENT : organizes
EVENT ||--o{ ROOM : has
EVENT ||--o{ ANONYMOUSINVITE : allows
ROOM ||--o{ ANONYMOUSINVITE : for
Updated class diagram for event feature flags and anonymous invite redirect viewclassDiagram
class Event {
int id
string slug
string locale
dict feature_flags
dict default_feature_flags()
}
class AnonymousInvite {
int id
string short_token
datetime expires
int event_id
int room_id
AnonymousInvite get(short_token, expires__gte)
}
class Organizer {
int id
string slug
string name
}
class Room {
int id
string name
}
class AnonymousInviteRedirectView {
get(request, token, args, kwargs)
}
class Router {
replace(relativePath)
resolve(relativePath)
}
class WebAppInit {
init(token, inviteToken)
}
Event *-- Organizer : organizer
Event *-- Room : rooms
Event o-- AnonymousInvite : invitations
AnonymousInvite *-- Room : room
AnonymousInviteRedirectView ..> AnonymousInvite : queries
AnonymousInviteRedirectView ..> Event : uses_event_data
WebAppInit ..> Router : uses
Router ..> Event : navigates_video_routes
class DefaultFeatureFlags {
bool use_submission_comments
bool present_multiple_times
bool submission_public_review
bool chat_moderation
bool polls
bool schedule_control
}
Event ..> DefaultFeatureFlags : merged_into_features
File-Level Changes
Assessment against linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New security issues found
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes two issues in the video/webapp integration: restores polling functionality for older events by ensuring default feature flags are applied, and resolves anonymous room invite link redirects that were conflicting with organizer slug routing.
Key Changes:
- Added default video feature flags (
chat-moderation,polls,schedule-control) to ensure backward compatibility for legacy events - Introduced
AnonymousInviteRedirectViewto handle short token URLs and redirect to standalone video views - Fixed Vue Router 4 compatibility by removing deprecated
.routeproperty access fromrouter.resolve()
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
app/eventyay/base/models/event.py |
Added video/webapp feature flags to defaults for backward compatibility |
app/eventyay/multidomain/maindomain_urlconf.py |
Implemented anonymous invite redirect view, added URL patterns, and merged feature flags in VideoSPAView |
app/eventyay/webapp/src/main.js |
Fixed Vue Router 4 compatibility by accessing route object directly from resolve() |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| # Merge default feature flags with event-specific flags to ensure | ||
| # newer features like 'polls' are available even for older events | ||
| from eventyay.base.models.event import default_feature_flags |
Copilot
AI
Dec 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The inline import of default_feature_flags within the view method can impact performance on every request. Consider moving this import to the top of the file with the other imports for better performance and code organization.
Move line 88 to the top-level imports section (around line 20-21 where other model imports are located).
|
@Sak1012 @Saksham-Sirohi @mariobehling Here are some screenshot's reagrding the changes polling-fix.mp4 |
|
@sourcery-ai review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there - I've reviewed your changes - here's some feedback:
Blocking issues:
- Detected a Generic API Key, potentially exposing access to various services and sensitive operations. (link)
General comments:
- The
default_feature_flagsimport inside thesafe_reverseclosure will run on every request; consider moving this import to module level (or guarding with a local alias) unless there is a circular import issue. - The top-level
anonymous_invite_patternsregex for any 6-character token at the root may inadvertently capture legitimate short paths (e.g. marketing slugs or future endpoints); consider namespacing these under a dedicated prefix (such as/i/<token>/) to avoid ambiguity.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The `default_feature_flags` import inside the `safe_reverse` closure will run on every request; consider moving this import to module level (or guarding with a local alias) unless there is a circular import issue.
- The top-level `anonymous_invite_patterns` regex for any 6-character token at the root may inadvertently capture legitimate short paths (e.g. marketing slugs or future endpoints); consider namespacing these under a dedicated prefix (such as `/i/<token>/`) to avoid ambiguity.
## Individual Comments
### Comment 1
<location> `app/eventyay/multidomain/maindomain_urlconf.py:162-171` </location>
<code_context>
+class AnonymousInviteRedirectView(View):
</code_context>
<issue_to_address>
**suggestion (bug_risk):** Build the redirect URL via URL reversing helpers to avoid hard‑coding the path.
The hard‑coded path is brittle if `video` routes (slugs, segments, or names) change and will break when the app is mounted under a subpath (SCRIPT_NAME). Please use `reverse` (or an existing `safe_reverse`/helper) with the route name and kwargs, then pass the reversed URL plus `#invite={token}` to `redirect()`.
Suggested implementation:
```python
class AnonymousInviteRedirectView(View):
"""
Handle anonymous room invite short tokens (e.g., /eGHhXr/).
Redirects to the video SPA standalone anonymous room view:
/{organizer}/{event}/video/standalone/{room_id}/anonymous#invite={token}
"""
def get(self, request, token, *args, **kwargs):
try:
invite = AnonymousInvite.objects.select_related(
'event', 'event__organizer', 'room'
).get(
```
```python
video_url = safe_reverse(
'video:standalone_anonymous',
kwargs={
'organizer': invite.event.organizer.slug,
'event': invite.event.slug,
'room_id': invite.room_id,
},
)
return redirect(f'{video_url}#invite={token}')
```
1. Ensure `redirect` is imported at the top of this file:
- `from django.shortcuts import redirect`
2. If `safe_reverse` is not already imported in this module, import it from wherever it is defined in your project (it appears to be used earlier in the same file, so this may already be in place).
3. Replace `'video:standalone_anonymous'` with the actual URL name of the SPA standalone anonymous video route, and adjust the `kwargs` keys (`'organizer'`, `'event'`, `'room_id'`) to match the URL pattern’s parameter names (e.g., `organizer_slug`, `event_slug`, `room_id`, etc.).
4. If your project convention uses `reverse` instead of `safe_reverse` here, you can swap `safe_reverse` for `reverse` and ensure `from django.urls import reverse` is imported.
</issue_to_address>
### Comment 2
<location> `app/eventyay/multidomain/maindomain_urlconf.py:332` </location>
<code_context>
abcdefghijklmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ123456789
</code_context>
<issue_to_address>
**security (generic-api-key):** Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
*Source: gitleaks*
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
This PR resolves two issues related to the video/webapp integration:
Changes
** Feature Flags for Video/Webapp (
event.py)**Added default feature flags to ensure newer video features are available for legacy events:
chat-moderationpollsschedule-controlMerged default and event-specific flags to maintain backward compatibility
** Anonymous Room Link Routing (
maindomain_urlconf.py)**AnonymousInviteRedirectViewto support short token URLs (e.g./eGHhXr/)/{organizer}/{event}/video/standalone/{room_id}/anonymous#invite={token}Vue Router Compatibility (
main.js)Vue Router 4compatibility whererouter.resolve()returns the route object directlyTesting
Related Issues
Resolves #1264
Summary by Sourcery
Restore video feature flags for legacy events and add support for anonymous room invite short-link redirects while ensuring Vue Router 4 compatibility in the webapp.
New Features:
Bug Fixes:
Enhancements: