VC/Zoom: Resolve registrant emails via a bulk user directory - #328
VC/Zoom: Resolve registrant emails via a bulk user directory#328moliholy wants to merge 8 commits into
Conversation
|
@ThiefMaster this is a bug currently, as with thousands of users the request returns a 504 and:
Regardless: it is very inefficient to perform O(n) queries to Zoom just get the emails. |
81ec441 to
0ce9da0
Compare
|
I confirm the optimizations are working fine after the fix was deployed in a customer's infra a few days ago. |
| if not (pending := g.pop('zoom_pending_registrations', None)): | ||
| return | ||
|
|
||
| self._preload_directory() |
There was a problem hiding this comment.
I think doing this unconditionally is extremely inefficient for the - often much more common - case of having few registrations and many Zoom users.
It would be good to have a setting for a threshold and/or cache the list of Zoom users in a more persistent way (for a few hours) and fall back to the individual lookup only for users that aren't in the cache.
There was a problem hiding this comment.
I added a hardcoded limit of 25 users to trigger the fetch in b55f974. I find a plugin setting too technical for users, as they don't really have to know about this issue nor I think can really evaluate the consequences.
In any case happy to change it if you think otherwise.
b55f974 to
f6e825b
Compare
When automatic registration is enabled on an event, resolving each registrant's Zoom-account email used to trigger its own
get_usercall. On an event with hundreds or thousands of registrants that meant one Zoom API call per person on every registration and approval, and once per participant on check-in.This PR removes that per-registrant call on both fronts:
On those same bulk paths, the check that decides whether a registrant is already covered by another active registration also used to run one database query per registrant. It now builds the set of active registrations for the event once per sync and reuses it, so a sync of thousands of registrants issues a single query instead of one per person.
It also fixes a related correctness issue on the sync path: a registration created while still awaiting moderation is no longer cancelled in Zoom. Only completed registrations are ever added to a meeting, so a pending one has nothing to cancel; the queued sync is now a no-op for it instead of issuing a cancellation that reached the registrant as a spurious cancellation notice.
Outgoing Zoom API requests are also logged at debug level, so the exact sequence of calls a registration or approval triggers can be traced when diagnosing a slow or misbehaving event.
Note: the directory lookup depends on the
user:read:list_users:adminscope.