closeio / sync-engine

GNU Affero General Public License v3.0
26 stars 9 forks source link

Only free inbox_uids if defined #941

Closed mrhiggi-close closed 3 weeks ago

mrhiggi-close commented 3 weeks ago

Testing email syncing, I encountered an error.

When the if self.is_all_mail(crispin_client): path isn't taken (because email can't sync?) then there is no inbox_uids defined.

Traceback (most recent call last):
  File "/opt/app/inbox/util/concurrency.py", line 75, in wrapped
    return func(*args, **kwargs)
  File "/opt/app/inbox/mailsync/backends/imap/generic.py", line 291, in _run_impl
    self.state = self.state_handlers[old_state]()
  File "/opt/app/inbox/util/concurrency.py", line 75, in wrapped
    return func(*args, **kwargs)
  File "/opt/app/inbox/mailsync/backends/imap/generic.py", line 421, in initial_sync
    self.initial_sync_impl(crispin_client)
  File "/opt/app/inbox/mailsync/backends/gmail.py", line 300, in initial_sync_impl
    del inbox_uids  # free up memory as soon as possible
UnboundLocalError: local variable 'inbox_uids' referenced before assignment
squeaky-pl commented 3 weeks ago

Oops