You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm opening this issue to track the follow-up work related to our email address visibility feature (#2369) once #10850 merges. There are a few critical items:
Some end-to-end testing
Make sure we send gravatars even if client_gravatar is set, with this setting.
Ensure that the mobile apps won't completely break when you toggle this setting. One valid approach would be to send a "restart server" event (and/or delete all active event queues for the realm), and then confirm that the mobile app's caching of users is properly reset with that code path (it should be).
Figure out a way to avoid doing a linear number of queries for the do_set_realm_property code for switching an organization; the existing code will likely timeout and thus fail to finish the transition for a large enough realm. The critical bit here is refactoring the changes to do a bulk save. We roughly want this:
if name == "email_address_visibility":
user_profiles_to_save = []
for user_profile in UserProfile.objects.filter(realm=realm, is_bot=False):
# Save the old email address as a temporary value on the UserProfile object.
user_profile.old_email = user_profile.email
user_profile.email = get_display_email_address(user_profile, realm)
user_profiles_to_save.append(user_profile)
# We do a bulk database update and then flush the realm's
# caches to avoid doing database queries linear in the number
# of users.
UserProfile.objects.bulk_update(user_profiles_to_save)
# The update_fields value here is a bit of a hack.
flush_realm(instance=realm, update_fields=['string_id'])
for user_profile in user_profiles_to_save:
# TODO: Design a bulk event for this or force-reload all
# clients, since this is linear work for our Tornado
# infrastructure.
if user_profile.email != user_profile.old_email:
send_user_email_update_event(user_profile)
but Django doesn't actually have a .objects.bulk_update feature. One reasonable solution would be to move the code we currently have to a different queue processor (e.g. the deferred_work one), where timeouts aren't as much of a problem.
The text was updated successfully, but these errors were encountered:
I'm opening this issue to track the follow-up work related to our email address visibility feature (#2369) once #10850 merges. There are a few critical items:
client_gravatar
is set, with this setting.do_set_realm_property
code for switching an organization; the existing code will likely timeout and thus fail to finish the transition for a large enough realm. The critical bit here is refactoring the changes to do a bulk save. We roughly want this:but Django doesn't actually have a
.objects.bulk_update
feature. One reasonable solution would be to move the code we currently have to a different queue processor (e.g. thedeferred_work
one), where timeouts aren't as much of a problem.The text was updated successfully, but these errors were encountered: