mattermost-mobile-upstream/app/utils
Nick Misasi 96a33da676
Add weekly recurring scheduled posts (#10025)
* Add repeat_type/repeat_timezone to scheduled posts data layer

Mirrors server support for weekly recurring scheduled posts (mattermost#37746):
- ScheduledPost schema v21 with repeat_type/repeat_timezone columns + migration
- ScheduledPostModel fields, toApi() now round-trips repeat fields and the
  previously-dropped type field (PUT is a full overwrite server-side)
- Transformer copies repeat fields and overwrites error_code instead of
  merging, so a recurring post that recovers clears its error state
- updateScheduledPost takes UpdateSchedulingInfo so reschedule can change
  recurrence; weekly requires a timezone at compile time

Co-authored-by: Nick Misasi <nick13misasi@gmail.com>

* Add Repeat weekly toggle to scheduling and reschedule screens

Gated on server >= 11.10 (no feature flag; older servers silently ignore
the repeat fields). The scheduled-post options sheet and the reschedule
screen share getScheduledPostRecurrence(), which resolves the recurrence
timezone (manual > automatic > UTC) matching the webapp. Rescheduling a
weekly post pre-checks the toggle; unchecking converts it to one-time.

Co-authored-by: Nick Misasi <nick13misasi@gmail.com>

* Show Repeats weekly tag and hide Send for recurring scheduled posts

Scheduled-post rows show an info tag next to the Send on... header when
the post repeats weekly and is not in an error state, matching the webapp.
The Send option is absent for recurring posts (sending now would end or
fork the series), and the options sheet height is now derived from the
same booleans that drive rendering. isRecurringScheduledPost() is the
canonical recurrence predicate in @utils/scheduled_post.

Co-authored-by: Nick Misasi <nick13misasi@gmail.com>

* Gate recurring scheduled posts on feature flag and disallow attachments

The server PR now gates recurrence behind the default-off
FeatureFlagRecurringScheduledPosts flag (only the off-to-weekly
transition is blocked when disabled) and rejects weekly posts with file
attachments, since files are bound to the first post they are attached
to. Replace the version gate with the flag check and hide the Repeat
weekly toggle when the draft has attachments; when the toggle is not
offered, the reschedule save omits the recurrence fields so an existing
series is preserved.

Co-authored-by: Nick Misasi <nick13misasi@gmail.com>

* Address CodeRabbit review feedback

- Gate the picker's recurrence payload on the toggle actually being
  offered, closing a race where the feature flag flips off while the
  sheet is open; add a regression test
- Use the real isScheduledPostModel predicate in the model round-trip
  test instead of mocking it
- Cover the automatic-timezone branch of getScheduledPostRecurrence
- Align new picker tests with the advanceTimers helper, use nullish
  coalescing for raw.type, and fix test names to the should... format

Co-authored-by: Nick Misasi <nick13misasi@gmail.com>

* Refresh cached scheduled posts whose recurrence differs from the server

Rows cached before the repeat columns existed hold '' until the server bumps
update_at, which could leave a weekly post looking one-time (and ending the
series on reschedule) for up to a week.

Co-authored-by: Nick Misasi <nick13misasi@gmail.com>

* Hide the channel and thread scheduled post indicator for recurring-only posts

Matches the webapp: a weekly series never leaves the list, so the indicator
only shows when at least one one-time post is scheduled. The thread count
now also excludes errored posts, like the channel count.

Co-authored-by: Nick Misasi <nick13misasi@gmail.com>

---------

Co-authored-by: Matty Code <mattycode@mattycode-1.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: mattermost-code <matty-code@mattermost.com>
2026-11-13 06:31:02 +00:00
..
alerts On iOS, resuming after the 5-minute window showed no biometric prompt — (#10102) 2026-09-02 15:03:13 +08:00
channel [MM-69735] Improve DM call user experience (#10017) 2026-09-03 19:44:10 +00:00
deep_link [MM-66560] Fix channel links ending in channel IDs (#10158) 2026-09-15 11:28:03 -04:00
document
draft Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
emoji Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
file Mm 68219 show placeholder for redacted files (#9719) 2026-10-15 15:59:13 -07:00
gallery Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
general
images Fix gallery image dimensions (#9247) 2025-11-10 19:18:27 +08:00
markdown Improve markdown code (#9164) 2025-11-04 10:05:56 +01:00
navigation Access channel action (#10223) 2026-11-05 17:56:33 +05:30
notification Access channel action (#10223) 2026-11-05 17:56:33 +05:30
performance Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
permalink Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
post Add weekly recurring scheduled posts (#10025) 2026-11-13 06:31:02 +00:00
post_list Mm 68219 show placeholder for redacted files (#9719) 2026-10-15 15:59:13 -07:00
role Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
scheduled_post Add weekly recurring scheduled posts (#10025) 2026-11-13 06:31:02 +00:00
search Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
security On iOS, resuming after the 5-minute window showed no biometric prompt — (#10102) 2026-09-02 15:03:13 +08:00
server [MM-70605][MM-70607] Scope pre-auth secret storage per server (#10149) 2026-10-23 12:02:41 +02:00
snack_bar Mm 68293 ephemeral mode warnings (#10140) 2026-10-01 18:13:22 +02:00
svg
tap
theme Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
thread
url MM-70606: Fix Edit Server pre-auth secret save on HTTPS-redirecting servers (#10252) 2026-10-30 12:54:39 +01:00
user [MM-71167] Disable admin-managed profile attributes (#10244) 2026-11-02 10:12:02 -05:00
apps.test.ts Add collapsible sections to mobile (#10189) 2026-10-23 09:11:52 -07:00
apps.ts Add collapsible sections to mobile (#10189) 2026-10-23 09:11:52 -07:00
bor.test.ts Ensured BoR post actions matches those in webapp (#9362) 2026-02-04 12:18:35 +05:30
bor.ts Ensured BoR post actions matches those in webapp (#9362) 2026-02-04 12:18:35 +05:30
buttonStyles.test.ts
buttonStyles.ts
categories.test.ts
categories.ts
channel_attributes.test.ts Mm 70564 channel labels use in channel creation (#10146) 2026-10-30 15:03:55 +01:00
channel_attributes.ts Mm 70564 channel labels use in channel creation (#10146) 2026-10-30 15:03:55 +01:00
channel_bookmark.test.ts Limit bookmark names to the server's 64 characters (#10211) 2026-10-04 10:23:59 +05:30
channel_bookmark.ts Limit bookmark names to the server's 64 characters (#10211) 2026-10-04 10:23:59 +05:30
channel_policy.test.ts Access channel action (#10223) 2026-11-05 17:56:33 +05:30
channel_policy.ts Access channel action (#10223) 2026-11-05 17:56:33 +05:30
classification.test.ts Mm 70299 channel labels display phase 1 (#10113) 2026-09-17 21:37:43 +02:00
classification.ts Mm 70299 channel labels display phase 1 (#10113) 2026-09-17 21:37:43 +02:00
config.test.ts Mm 68767 zero persistence (#9803) 2026-07-16 13:55:45 +02:00
config.ts Mm 68293 ephemeral mode warnings (#10140) 2026-10-01 18:13:22 +02:00
custom_profile_attribute.ts
database_errors.test.ts [MM-68315] Add autorecovery for database corruptions (#9900) 2026-07-13 18:02:35 +02:00
database_errors.ts [MM-68315] Add autorecovery for database corruptions (#9900) 2026-07-13 18:02:35 +02:00
date_utils.test.ts Add date/datetime field support with timezone features for Apps Forms (#9521) 2026-07-16 08:09:47 -06:00
date_utils.ts Add date/datetime field support with timezone features for Apps Forms (#9521) 2026-07-16 08:09:47 -06:00
datetime.test.ts FIX: Correct Android minute interval and UTC+offset date display in datetime fields (#10202) 2026-10-22 15:12:27 -05:00
datetime.ts FIX: Correct Android minute interval and UTC+offset date display in datetime fields (#10202) 2026-10-22 15:12:27 -05:00
dialog_conversion.test.ts Render interactive dialog textarea elements as multi-line inputs (#10269) 2026-11-12 13:49:34 -06:00
dialog_conversion.ts Render interactive dialog textarea elements as multi-line inputs (#10269) 2026-11-12 13:49:34 -06:00
dialog_utils.test.ts MM-69220: Support concurrent interactive dialogs via action_button elements (#10049) 2026-11-11 14:15:18 -06:00
dialog_utils.ts MM-69220: Support concurrent interactive dialogs via action_button elements (#10049) 2026-11-11 14:15:18 -06:00
error_handling.test.ts On iOS, resuming after the 5-minute window showed no biometric prompt — (#10102) 2026-09-02 15:03:13 +08:00
error_handling.ts Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
errors.test.ts
errors.ts [MM-70605][MM-70607] Scope pre-auth secret storage per server (#10149) 2026-10-23 12:02:41 +02:00
files.test.ts
files.tsx feat(iOS): Add Microsoft Intune MAM integration with multi-server support (#9312) 2025-12-10 13:07:28 +02:00
grapheme.test.ts New keyboard library Setup (#9278) 2026-01-13 22:38:35 +05:30
grapheme.ts New keyboard library Setup (#9278) 2026-01-13 22:38:35 +05:30
groups.test.ts
groups.ts
headers.test.ts Fix case-insensitive pre-auth header check in doPing (#9577) 2026-03-17 12:07:07 +01:00
headers.ts [MM-70605][MM-70607] Scope pre-auth secret storage per server (#10149) 2026-10-23 12:02:41 +02:00
helpers.test.ts Classification Markings: Cached request timer and PSv2 Implementation (#9926) 2026-08-13 15:24:07 +03:00
helpers.ts Classification Markings: Cached request timer and PSv2 Implementation (#9926) 2026-08-13 15:24:07 +03:00
integrations.test.ts MM-69122: Add file element support to interactive dialogs (#9898) 2026-10-07 14:43:26 -05:00
integrations.ts MM-69122: Add file element support to interactive dialogs (#9898) 2026-10-07 14:43:26 -05:00
interactive_dialog_adapter.test.ts Add collapsible sections to mobile (#10189) 2026-10-23 09:11:52 -07:00
interactive_dialog_adapter.ts Add collapsible sections to mobile (#10189) 2026-10-23 09:11:52 -07:00
intune_errors.test.ts add support on iOS for Intune Conditional Access (#9660) 2026-04-09 17:46:52 +03:00
intune_errors.ts add support on iOS for Intune Conditional Access (#9660) 2026-04-09 17:46:52 +03:00
key_mirror.test.ts
key_mirror.ts
keyboard.test.ts Mm 67525 bump min version (#9640) 2026-09-16 10:53:06 +00:00
keyboard.ts Mm 67525 bump min version (#9640) 2026-09-16 10:53:06 +00:00
log.test.ts
log.ts
mattermost_managed.test.ts
mattermost_managed.ts
message_attachment.test.ts
message_attachment.ts
mix.test.ts
mix.ts
opengraph.test.ts fix: Product fixes to run e2e tests (#10081) 2026-08-26 16:12:37 +05:30
opengraph.ts fix: Product fixes to run e2e tests (#10081) 2026-08-26 16:12:37 +05:30
permalink_sync.test.ts
permalink_sync.ts
phone_number.test.ts MM-70688 Autolink phone numbers in posts as tel: links (#10143) 2026-09-14 14:32:17 -04:00
phone_number.ts MM-70688 Autolink phone numbers in posts as tel: links (#10143) 2026-09-14 14:32:17 -04:00
push_proxy.test.ts
push_proxy.ts
remote_cluster_connection.test.ts [MM-67923] Add channel settings for shared channels (#9591) 2026-04-14 11:43:44 +02:00
remote_cluster_connection.ts [MM-67923] Add channel settings for shared channels (#9591) 2026-04-14 11:43:44 +02:00
render_permissions.test.ts MM-70693: Hide burn-on-read quick action when ABAC policy denies it (#10239) 2026-10-16 15:13:04 -07:00
render_permissions.ts MM-70693: Hide burn-on-read quick action when ABAC policy denies it (#10239) 2026-10-16 15:13:04 -07:00
reviews.test.ts Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
reviews.ts Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
saml_challenge.ts
sentry.test.ts Fix Regressions (#9808) 2026-06-04 06:54:40 +08:00
sentry.ts Fix Regressions (#9808) 2026-06-04 06:54:40 +08:00
share_logs.test.ts Report a problem not redirect to default email application (#9703) 2026-05-14 09:10:39 -04:00
share_logs.ts Report a problem not redirect to default email application (#9703) 2026-05-14 09:10:39 -04:00
strings.test.ts
strings.ts
subscription.test.ts Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
subscription.ts Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
team_menu.test.ts Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
team_menu.ts Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
time.test.ts [MM-71006] Update timezone data to 2026d (#10201) 2026-10-05 19:10:40 +08:00
time.ts
timezone.test.ts FIX: Correct Android minute interval and UTC+offset date display in datetime fields (#10202) 2026-10-22 15:12:27 -05:00
timezone.ts FIX: Correct Android minute interval and UTC+offset date display in datetime fields (#10202) 2026-10-22 15:12:27 -05:00
types.ts
typography.test.ts
typography.ts