Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't break on missing categories #475

Merged
merged 1 commit into from
Mar 16, 2023

Conversation

squeaky-pl
Copy link
Contributor

@squeaky-pl squeaky-pl commented Mar 16, 2023

This is a stop gap solution for #302.

There's a pretty laud rollbar both on CRM and sync-engine side.

category can be None because somebody at Nylas decided to drop a foreign key mentioned in the issue. We should still investigate if we can add those constraints back because the decision to drop such constraints does not look like a correct one to me. In the meantime let's ship this because for people that hit this problem we simply get stuck on this and stop syncing their inboxes.

sent_recent_date = m.received_date
for message in sorted_messages:
if "sent" in [
category.name for category in message.categories if category
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if category is the part that I added to filter out None categories that come from missing categories because of missing FK.

@squeaky-pl squeaky-pl requested a review from drewler March 16, 2023 10:28
@squeaky-pl squeaky-pl merged commit 9a785f0 into master Mar 16, 2023
@squeaky-pl squeaky-pl deleted the dont-break-on-missing-categories branch March 16, 2023 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants