mattermost-mobile-upstream/app/database/schema/server/index.ts
cursor[bot] 0869dc8eab
[MM-62038] Fix urgent mention badge colors (#10119)
* [MM-62038] Fix urgent mention badge colors

Persist urgent mention counts and use them to render channel list badges with the urgent color treatment.

Co-authored-by: mattermost-code <matty-code@mattermost.com>

* Address CodeRabbit feedback on urgent mention count persistence

Skip unread updates when fetchMyChannel fails so persisted urgent
counts are not cleared, and preserve urgentMentionCount on partial
MyChannel transformer updates.

Co-authored-by: mattermost-code <matty-code@mattermost.com>

* Use should... names for urgent mention transformer tests

CodeRabbit requested the parameterized transformMyChannelRecord cases
start with should, matching the repo test-name guideline.

Co-authored-by: mattermost-code <matty-code@mattermost.com>

* Address PR feedback: 1 answered, 1 resolved, 0 declined

Persist urgent mention counts on the native killed-app push path
so in-app channel list badges stay urgent-colored after a cold start.

Co-authored-by: mattermost-code <matty-code@mattermost.com>

* Persist computed is_unread on iOS MyChannel update path

CodeRabbit flagged isUnreadCol <- isUnreadCol, which is a no-op.
Write the computed isUnread value so native push updates store
recalculated unread state, matching the insert path and Android.

Co-authored-by: mattermost-code <matty-code@mattermost.com>

* Address PR feedback: 2 answered, 1 resolved, 0 declined

Use the active theme's buttonColor for urgent mention badge text
instead of hardcoded Denim.

Co-authored-by: mattermost-code <matty-code@mattermost.com>

* Address PR feedback: 1 answered, 1 resolved, 0 declined

Treat omitted urgent_mention_count as 0 in transformMyChannelRecord.

Co-authored-by: mattermost-code <matty-code@mattermost.com>

---------

Co-authored-by: Matty Code <mattycode@mattycode-3.com>
Co-authored-by: mattermost-code <matty-code@mattermost.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-09-14 14:03:53 -04:00

102 lines
2.7 KiB
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {BoardViewSchema} from '@boards/database/schema';
import {type AppSchema, appSchema} from '@nozbe/watermelondb';
import {AiBotSchema, AiThreadSchema} from '@agents/database/schema';
import {PlaybookRunSchema, PlaybookChecklistSchema, PlaybookChecklistItemSchema, PlaybookRunAttributeSchema, PlaybookRunAttributeValueSchema} from '@playbooks/database/schema';
import {
CategorySchema,
CategoryChannelSchema,
ChannelSchema,
ChannelBookmarkSchema,
ChannelInfoSchema,
ChannelMembershipSchema,
ConfigSchema,
CustomEmojiSchema,
CustomProfileFieldSchema,
CustomProfileAttributeSchema,
DraftSchema,
FileSchema,
GroupSchema,
GroupChannelSchema,
GroupMembershipSchema,
GroupTeamSchema,
MyChannelSchema,
MyChannelSettingsSchema,
MyTeamSchema,
PostInThreadSchema,
PostSchema,
PostsInChannelSchema,
PreferenceSchema,
PropertyFieldSchema,
PropertyValueSchema,
ReactionSchema,
RoleSchema,
ScheduledPostSchema,
SystemSchema,
TeamChannelHistorySchema,
TeamMembershipSchema,
TeamSchema,
TeamSearchHistorySchema,
ThreadSchema,
ThreadInTeamSchema,
ThreadParticipantSchema,
TeamThreadsSyncSchema,
UserSchema,
} from './table_schemas';
export const serverSchema: AppSchema = appSchema({
version: 21,
tables: [
AiBotSchema,
AiThreadSchema,
CategorySchema,
CategoryChannelSchema,
ChannelSchema,
ChannelBookmarkSchema,
ChannelInfoSchema,
ChannelMembershipSchema,
ConfigSchema,
CustomEmojiSchema,
CustomProfileFieldSchema,
CustomProfileAttributeSchema,
DraftSchema,
FileSchema,
GroupSchema,
GroupChannelSchema,
GroupMembershipSchema,
GroupTeamSchema,
MyChannelSchema,
MyChannelSettingsSchema,
MyTeamSchema,
PlaybookRunSchema,
PlaybookChecklistSchema,
PlaybookChecklistItemSchema,
PlaybookRunAttributeSchema,
PlaybookRunAttributeValueSchema,
PostInThreadSchema,
PostSchema,
PostsInChannelSchema,
PreferenceSchema,
PropertyFieldSchema,
PropertyValueSchema,
ReactionSchema,
RoleSchema,
ScheduledPostSchema,
SystemSchema,
TeamChannelHistorySchema,
TeamMembershipSchema,
TeamSchema,
TeamSearchHistorySchema,
TeamThreadsSyncSchema,
ThreadSchema,
ThreadInTeamSchema,
ThreadParticipantSchema,
UserSchema,
BoardViewSchema,
],
});