Closed lukesmurray closed 5 years ago
I think we should make "updating our cache" should happen only in one part of our codebase to make our workflow clear. So when a user does add_flags() or remove_flags(), we should only change flags at IMAP but not at our database, which will be triggered flag change event at your sync function then it will be added to our DB.
The only issue with that approach is it creates a potential assertion problem but I guess if we're clear about that it doesn't matter.
msg.remove_flags('important')
assert 'important' not in msg.flags # this fails
If we do add_flags and save the new flags to our cache we cannot fire flag_added events since the message appears to already have that flag set. Same goes for flag_removed. What is the desired behavior in this case?