Skip to content

Conversation

@harshilsharma63
Copy link
Member

Summary

Added DB migration for adding type column to Scheduled Post and Draft tables.

Ticket Link

Fixes https://mattermost.atlassian.net/browse/MM-66947

Checklist

  • Added or updated unit tests (required for all new features)
  • Has UI changes
  • Includes text changes and localization file updates
  • Have tested against the 5 core themes to ensure consistency between them.
  • Have run E2E tests by adding label E2E iOS tests for PR.

Device Information

This PR was tested on: iOS emulator

Screenshots

NA

Release Note

None

@github-actions
Copy link

github-actions bot commented Dec 12, 2025

Coverage Comparison Report

Generated on December 15, 2025 at 05:34:29 UTC

+-----------------+------------+------------+-----------+
| Metric          | Main       | This PR    | Diff      |
+-----------------+------------+------------+-----------+
| Lines           |     86.18% |     86.17% |    -0.01% |
| Statements      |     86.06% |     86.05% |    -0.01% |
| Branches        |     72.61% |     72.61% |     0.00% |
| Functions       |     85.40% |     85.40% |     0.00% |
+-----------------+------------+------------+-----------+
| Total           |     82.56% |     82.55% |    -0.01% |
+-----------------+------------+------------+-----------+

Copy link
Contributor

@enahum enahum left a comment

Choose a reason for hiding this comment

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

sorry for the amount of comments

@field('update_at') updateAt!: number;

/** type : The type of post */
@field('type') type?: PostTypesUserCreatable;
Copy link
Contributor

Choose a reason for hiding this comment

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

this makes it undefined, not null.. the database can store null not undefined.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah I see. Thats why we have many fields defined with as fieldName: Type | null

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@field('error_code') errorCode!: string;

/** type : The type of the post being scheduled */
@field('type') type?: PostTypesUserCreatable;
Copy link
Contributor

Choose a reason for hiding this comment

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

same here

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

scheduledPost.processedAt = raw.processed_at ?? 0;
scheduledPost.errorCode = raw.error_code || scheduledPost.errorCode;

// LOL
Copy link
Contributor

Choose a reason for hiding this comment

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

here we go again

Copy link
Member Author

Choose a reason for hiding this comment

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

Done. Removed with updated code.

{name: 'root_id', type: 'string', isIndexed: true},
{name: 'metadata', type: 'string', isOptional: true},
{name: 'update_at', type: 'number'},
{name: 'type', type: 'string'},
Copy link
Contributor

Choose a reason for hiding this comment

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

missing isOptional

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

{name: 'scheduled_at', type: 'number'},
{name: 'processed_at', type: 'number'},
{name: 'error_code', type: 'string'},
{name: 'type', type: 'string'},
Copy link
Contributor

Choose a reason for hiding this comment

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

missing isOptional

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

scheduled_at: {name: 'scheduled_at', type: 'number'},
processed_at: {name: 'processed_at', type: 'number'},
error_code: {name: 'error_code', type: 'string'},
type: {name: 'type', type: 'string'},
Copy link
Contributor

Choose a reason for hiding this comment

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

missing isOptional

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

{name: 'scheduled_at', type: 'number'},
{name: 'processed_at', type: 'number'},
{name: 'error_code', type: 'string'},
{name: 'type', type: 'string'},
Copy link
Contributor

Choose a reason for hiding this comment

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

missing isOptional

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor

Choose a reason for hiding this comment

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

Fail to see the reason for this change

Copy link
Member Author

Choose a reason for hiding this comment

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

I always get these two diffs - project.pbxproj and Podfile.lockfile. What version of xcode and cocoapods do you use? I'm on xcode 26.1 and pod 1.16.1

Copy link
Contributor

@enahum enahum Dec 15, 2025

Choose a reason for hiding this comment

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

Same version, let's just remove this change and the Podfile.lock as well

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor

Choose a reason for hiding this comment

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

same here

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

updateAt: number;

/** type : The post type of draft */
type?: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
type?: string;
type: string | null;

this aligns better unless you plan to have the transformer set it to null if undefined

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor

@enahum enahum left a comment

Choose a reason for hiding this comment

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

Approving with the condition to revert the changes in the project and podfile lock files

@amyblais amyblais added this to the v2.36.0 milestone Dec 15, 2025
@amyblais amyblais added 2: Dev Review Requires review by a core commiter CherryPick/Approved Meant for the quality or patch release tracked in the milestone labels Dec 15, 2025
@harshilsharma63
Copy link
Member Author

@amyblais this isn't necessary for upcoming code freeze date. This can be part of the later release.

@harshilsharma63 harshilsharma63 changed the title Bor scheduled posts and drafts Bor scheduled posts and drafts migration Dec 15, 2025
@harshilsharma63 harshilsharma63 changed the title Bor scheduled posts and drafts migration BoR scheduled posts and drafts Dec 15, 2025
@amyblais amyblais removed this from the v2.36.0 milestone Dec 15, 2025
@amyblais amyblais removed the CherryPick/Approved Meant for the quality or patch release tracked in the milestone label Dec 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2: Dev Review Requires review by a core commiter release-note-none

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants