iachat/app
Sivin Varghese 7c2ca1a07e
fix: Not using saved order_by when fetching conversation list (#11008)
# Pull Request Template

## Description

This PR fixes the issue where the saved `order_by` value for the
conversation list is not being applied. The feature was originally added
in PR https://github.com/chatwoot/chatwoot/pull/8237 but broke after
merging the Vue 3 migration PR
https://github.com/chatwoot/chatwoot/pull/10047

Fixes
https://linear.app/chatwoot/issue/CW-4110/not-using-the-saved-sort-order-by-option-from-ui-settings

**Cause of the Issue:**  
The previous implementation checked `orderBy` against the keys of the
sorting constants instead of their values. Since `orderBy` stores a
sorting value, this caused the condition to fail, leading to fallback to
the default sorting option.

**Solution:**  
The fix ensures that `orderBy` is validated against the values of the
sorting constants rather than the keys. This correctly applies the saved
sorting preference, while still falling back to the default if needed.

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)

## How Has This Been Tested?

**Loom video**

https://www.loom.com/share/ebe8a4d3f1c041c6862334dc3b6d43a3?sid=5167feb7-eb4a-4f2c-8211-662830ba946c




## Checklist:

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my code
- [ ] I have commented on my code, particularly in hard-to-understand
areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [x] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream
modules
2025-03-03 14:22:27 +05:30
..
actions chore: Avoid contact inboxes getting deleted (#10612) 2024-12-26 16:17:38 +05:30
assets feat: Vite + vue 3 💚 (#10047) 2024-10-02 00:36:30 -07:00
builders feat(v4): Update the report pages to show aggregate values (#10766) 2025-01-28 09:19:18 +05:30
channels chore: Sentry issues (#4623) 2022-05-06 14:50:55 +05:30
controllers feat: move Linear config to installation_config (#10999) 2025-02-28 14:20:27 +05:30
dashboards feat: Display Account Custom Attributes in Super Admin (#10459) 2024-11-20 09:02:33 -08:00
dispatchers feat(ee): Add Captain features (#10665) 2025-01-14 16:15:47 -08:00
drops feat: Add the support for custom attributes in message variables (#8511) 2023-12-08 14:13:35 -08:00
fields feat: setup captain limits (#10713) 2025-01-23 01:23:18 +05:30
finders feat: Conversation API to return applied_sla and sla_events (#9174) 2024-04-01 23:30:07 +05:30
helpers feat: move Linear config to installation_config (#10999) 2025-02-28 14:20:27 +05:30
javascript fix: Not using saved order_by when fetching conversation list (#11008) 2025-03-03 14:22:27 +05:30
jobs chore: Add more conversation events for reload (#10877) 2025-02-11 00:33:45 -08:00
listeners fix: Use message sender ID in the analytics for first response time (#9605) 2024-06-06 20:20:35 -07:00
mailboxes fix: Process non-image inline attachments as regular attachments (#10998) 2025-02-28 13:33:48 -08:00
mailers feat: add Google Email fetch and OAuth token refresh service (#9603) 2024-06-11 14:22:03 +05:30
models feat: Add support for account abuse detection (#11001) 2025-02-28 15:28:19 -08:00
policies fix: Added authentication to FireCrawl API, remove unused RobinAI references (#10737) 2025-01-22 18:14:25 -08:00
presenters chore: Update the precision of the updated_at timestamp in conversation model (#10875) 2025-02-10 20:22:11 -08:00
services chore: Disable email notifications for unconfirmed users (#10964) 2025-02-24 12:14:40 -08:00
views feat: move Linear config to installation_config (#10999) 2025-02-28 14:20:27 +05:30
workers fix: Capture delivery errors to avoid false positives (#8790) 2024-01-26 14:22:18 +04:00