mattermost-mobile-upstream/app
Mattermost Build 6d2c37dda1
[MM-68856] Respect default agent and persist last-selected agent in agent selectors (#9829) (#9937)
* [MM-68856] Respect default agent and persist last-selected agent in agent selectors

Mobile agent selectors always defaulted to the first agent and did not
remember the user's previous choice, ignoring the system-wide default
agent configured on the server.

Selectors now resolve the active agent with the precedence
saved-preference -> system default (is_default) -> first, and persist
explicit selections via the shared `agents/selected_agent` core
preference so the choice restores across surfaces and clients.

Applied to the rewrite options, channel summary, and agent chat
selectors. Part of a coordinated 3-repo change (webapp,
mattermost-plugin-agents, mobile) sharing the same preference contract.



* [MM-68856] Address review feedback on agent selector

- await savePreference in saveSelectedAgent so its errors stay inside the
  try/catch and callers get a consistent {error} result.
- Surface persistence failures from the resolved {error} on all three
  selector surfaces (agent chat, channel summary, rewrite options) via
  logError instead of dropping them silently.
- Rename agent selection tests to the `should...` convention.



* [MM-68856] Address review feedback on agent selector structure

Split channel summary and rewrite options HOCs into index files, switch
persist calls to async/await, and cover non-empty selectedAgentId on mount.



* [MM-68856] Log agent selection failures with getFullErrorMessage



---------


(cherry picked from commit 344062a19d)

Co-authored-by: Nick Misasi <nick.misasi@mattermost.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-17 08:28:24 +03:00
..
actions [MM-68315] Add autorecovery for database corruptions (#9900) 2026-07-13 18:02:35 +02:00
client MM-68208 Implementing global and channel-level banners on mobile (#9752) 2026-07-08 12:47:01 +03:00
components Add date/datetime field support with timezone features for Apps Forms (#9521) (#9933) 2026-07-17 08:04:27 +03:00
constants [MM-68856] Respect default agent and persist last-selected agent in agent selectors (#9829) (#9937) 2026-07-17 08:28:24 +03:00
context Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
database [MM-68315] Add autorecovery for database corruptions (#9900) 2026-07-13 18:02:35 +02:00
helpers Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
hooks [MM-69227] Fix back button behavior (#9927) 2026-07-13 17:43:09 +02:00
i18n Add autotranslations (#9324) 2026-02-10 17:50:39 +01:00
init [MM-69457] Stop logging PII in exportable app logs (#9884) 2026-07-02 12:19:04 +02:00
keyboard resumes slide animation after stopping due to modal system dialog showing (#9792) 2026-05-29 06:50:57 +08:00
managers [MM-68315] Add autorecovery for database corruptions (#9900) 2026-07-13 18:02:35 +02:00
products [MM-68856] Respect default agent and persist last-selected agent in agent selectors (#9829) (#9937) 2026-07-17 08:28:24 +03:00
queries [MM-68315] Add autorecovery for database corruptions (#9900) 2026-07-13 18:02:35 +02:00
routes MM-68208 Implementing global and channel-level banners on mobile (#9752) 2026-07-08 12:47:01 +03:00
screens Fix passing number strings through screen params (#9931) (#9936) 2026-07-17 08:10:16 +03:00
store Receive Mattermost Calls through iOS native incoming-call UI (#9780) 2026-06-16 12:08:14 -03:00
utils Fix passing number strings through screen params (#9931) (#9936) 2026-07-17 08:10:16 +03:00