mirror of https://github.com/zulip/zulip.git
zephyr_mirror: Compare zephyr subs from server after normalization.
(imported from commit eea290698e83c7d26f23ab3bb0201914417f0e09)
This commit is contained in:
parent
18aace499c
commit
de3799589b
|
@ -34,6 +34,7 @@ import textwrap
|
|||
import signal
|
||||
import logging
|
||||
import hashlib
|
||||
import unicodedata
|
||||
|
||||
DEFAULT_SITE = "https://humbughq.com"
|
||||
|
||||
|
@ -158,7 +159,12 @@ def zephyr_bulk_subscribe(subs):
|
|||
# (within 15 seconds).
|
||||
return
|
||||
for (cls, instance, recipient) in subs:
|
||||
if cls not in actual_zephyr_subs:
|
||||
# Zephyr class names are canonicalized by first applying NFKC
|
||||
# normalization and then lower-casing server-side -- so we
|
||||
# need to compare against those to see if we've successfully
|
||||
# subscribed.
|
||||
canonical_cls = unicodedata.normalize("NFKC", cls.decode("utf-8").lower()).encode("utf-8")
|
||||
if canonical_cls not in actual_zephyr_subs:
|
||||
logging.error("Zephyr failed to subscribe us to %s; will retry" % (cls,))
|
||||
try:
|
||||
# We'll retry automatically when we next check for
|
||||
|
|
Loading…
Reference in New Issue