Skip to content

Conversation

@jpmelos
Copy link
Member

@jpmelos jpmelos commented Feb 19, 2025

Allow ordering messages by received date ascending. (And leaves room for more configurable options in the future if desired.) This is useful when debugging things related to syncing emails into Close, and you want to see emails in the order they arrived to understand how the code on the Close side was run.

@jpmelos jpmelos self-assigned this Feb 19, 2025
@jpmelos jpmelos force-pushed the jpmelos-make-messages-ordering-configurable branch from cb9672a to 8340748 Compare February 19, 2025 23:05
@jpmelos jpmelos force-pushed the jpmelos-make-messages-ordering-configurable branch from 8340748 to af6e27f Compare August 22, 2025 14:28
@jpmelos jpmelos force-pushed the jpmelos-make-messages-ordering-configurable branch from af6e27f to 2d104cb Compare August 22, 2025 14:49
@jpmelos jpmelos marked this pull request as ready for review August 22, 2025 14:54
@jpmelos jpmelos requested a review from a team August 22, 2025 14:55
query = query.order_by(desc(Message.received_date))
elif order_by == "received_date":
query = query.order_by(asc(Message.received_date))
elif order_by == "-received_date":
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Personally, I'd go for if not order_by or order_by == "-received_date"

Copy link
Member Author

Choose a reason for hiding this comment

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

The reason I did this is to preserve the semantic difference between "the default" and "the choice that happens to behave the same as the default".

@jpmelos jpmelos merged commit c2d0a5a into master Aug 25, 2025
4 checks passed
@jpmelos jpmelos deleted the jpmelos-make-messages-ordering-configurable branch August 25, 2025 14:32
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.

4 participants