forked from Ivasoft/mattermost-mobile
Add column last_fetched_at to MyChannel & Thread tables and the migration (#6433)
* Add column last_fetched_at to MyChannel & Thread tables and the migration * Fix schema tests * Handle lastFetchAt, retrieve threads on init and properly observe thread unreads (#6436) * [Gekidou] Set lastFetchAt when fetching posts for a channel (#6437) * Set lastFetchAt when fetching posts for a channel * When resetting _preparedState set always to null * Revert changes in WS * Handle and set lastFetchedAt for MyChannel in iOS push notification * feedback review * iOS fallback to last post createAt if no lastFetchAt set * Handle lastFetchAt on Android push notifications * create storePostsForChannel local action * Fix iOS fallback to last post create_at Co-authored-by: Daniel Espino García <larkox@gmail.com>
This commit is contained in:
2
types/database/database.d.ts
vendored
2
types/database/database.d.ts
vendored
@@ -89,7 +89,7 @@ export type HandlePostsArgs = {
|
||||
};
|
||||
|
||||
export type HandleThreadsArgs = {
|
||||
threads?: Thread[];
|
||||
threads?: ThreadWithLastFetchedAt[];
|
||||
prepareRecordsOnly?: boolean;
|
||||
teamId?: string;
|
||||
loadedInGlobalThreads?: boolean;
|
||||
|
||||
@@ -17,6 +17,9 @@ export default class MyChannelModel extends Model {
|
||||
/** last_post_at : The timestamp for any last post on this channel */
|
||||
lastPostAt: number;
|
||||
|
||||
/** last_fetched_at : The timestamp when we successfully last fetched post on this channel */
|
||||
lastFetchedAt: number;
|
||||
|
||||
/** last_viewed_at : The timestamp showing the user's last viewed post on this channel */
|
||||
lastViewedAt: number;
|
||||
|
||||
@@ -43,4 +46,6 @@ export default class MyChannelModel extends Model {
|
||||
|
||||
/** settings: User specific settings/preferences for this channel */
|
||||
settings: Relation<MyChannelSettingsModel>;
|
||||
|
||||
resetPreparedState: () => void;
|
||||
}
|
||||
|
||||
3
types/database/models/servers/thread.d.ts
vendored
3
types/database/models/servers/thread.d.ts
vendored
@@ -20,6 +20,9 @@ export default class ThreadModel extends Model {
|
||||
/** lastReplyAt : The timestamp of when user last replied to the thread. */
|
||||
lastReplyAt: number;
|
||||
|
||||
/** last_last_fetched_at_at : The timestamp when we successfully last fetched post on this channel */
|
||||
lastFetchedAt: number;
|
||||
|
||||
/** lastViewedAt : The timestamp of when user last viewed the thread. */
|
||||
lastViewedAt: number;
|
||||
|
||||
|
||||
2
types/database/raw_values.d.ts
vendored
2
types/database/raw_values.d.ts
vendored
@@ -116,7 +116,7 @@ type RawValue =
|
||||
| TeamChannelHistory
|
||||
| TeamMembership
|
||||
| TeamSearchHistory
|
||||
| Thread
|
||||
| ThreadWithLastFetchedAt
|
||||
| ThreadInTeam
|
||||
| ThreadParticipant
|
||||
| UserProfile
|
||||
|
||||
Reference in New Issue
Block a user