-
Notifications
You must be signed in to change notification settings - Fork 2k
fix: Fix bug in which emails would be fetched during initial indexing #4959
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
PR Summary
Fixed asymmetric permission handling in Teams connector where email addresses were inconsistently populated between regular indexing and slim-document retrieval paths.
- Consolidated permission logic into new
fetch_external_access
utility inbackend/onyx/connectors/teams/utils.py
to ensure consistent behavior across retrieval paths - Added
public()
classmethod toExternalAccess
inbackend/onyx/access/models.py
for standardized creation of public document instances - Removed redundant
_is_channel_public
helper and moved_PUBLIC_MEMBERSHIP_TYPE
constant to module level for better organization - Ensured
ExternalAccess
instances maintain identical states between slim and full document retrieval
3 files reviewed, no comments
Edit PR Review Bot Settings | Greptile
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.
looks good, left a comment
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.
1 nit
…onyx-dot-app#4959) * Add new convenience method * Fix bug in which emails would be fetched for initial indexing * Improve tests for MS Teams connector * Fix test_gdrive_perm_sync_with_real_data patching * Protect against incorrect truthiness --------- Co-authored-by: Weves <chrisweaver101@gmail.com>
Description
During initial sync, the
ExternalAccess.external_user_emails
field of aDocument
will always be populated with a set of actual user-emails, regardless of whether that channel is public or not.During permission-sync, the
ExternalAccess.external_user_emails
will only be populated with the actual emails if that channel is private. Otherwise (if it's public), it'll set that field to the empty set.This is asymmetric behaviour; we want both initial-indexing + permission-sync to produce identical
ExternalAccess
instances (given that the underlying document's permissions have not changed).This PR fixes that issue.
Addresses: https://linear.app/danswer/issue/DAN-2150/fix-asymmetric-bug-in-externalaccess-generation-for-perm-sync-vs.
How Has This Been Tested?
Existing tests are sufficient.