* MM-49845: fixes acknowledgements in getpostsince
GetPostsSince returns posts updated after a user requested date.
If a user acknowledges a post the post's update at won't change thus not
getting that post returned from GetPostsSince. This is troublesome
particularly for the mobile client since it relies a lot to
GetPostsSince for keeping the data up to date.
This commit updates the post's update_at when a user
acknowledges/un-acknowledges a post fixing this way the issue above.
* Fixes linter
* Apply suggestions from code review
style changes
Co-authored-by: Jesse Hallam <jesse@thehallams.ca>
* Rename ack to acknowledgement
Co-authored-by: Jesse Hallam <jesse@thehallams.ca>
https://mattermost.atlassian.net/browse/MM-39215
```release-note
We now have Grafana metrics for DB connection metrics.
They are:
max_open_connections
open_connections
in_use_connections
idle_connections
wait_count_total
wait_duration_seconds_total
max_idle_closed_total
max_idle_time_closed_total
max_lifetime_closed_total
```
We accept a context that can cancel the query.
This allows us to exit a job faster.
```release-note
Compliance export job can now cancel the SQL query
execution during server shutdown which will allow
the job to exit faster.
```
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
* MM-49077: fixes errors in migration job
UrgentMentionCount does not have a default values, so COALESCE has to be
used.
SELECT * FROM ChannelMembers fails for the above reason.
This commit SELECTs each and every column from ChannelMembers instead.
* Fixes syntax error
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
* MM-48614: saves priority for drafts
Adds a new column in the drafts table, "priority".
This way we can save post's priority in the draft.
Fixes OmitConnectionId, which when you published a ws event for a user
was getting bypassed.
Fixes Get for drafts returns deleted ones as well, which is needed for
upsert.
* Adds test case for the OmitConnectionId
* Addresses review comments, removes DeleteAt
* Vets
* Adds missing translation
* Re-instates DeleteAt column
* Adds separate case to get draft including deleted
* Fixes Update Draft
* Empty
* Adds new function to use in place of isRole that includes team and channel schemes.
* Adds tests. Fixes code.
* Adds warning to isRole.
* Fixes phrasing.
* Added more docs.
* Moved from strings to constants.
* Added some spacing and improved some comments.
* Renames some functions.
* Rename isNotRole to isNotExactRole. Add a new isNotRole function.
* Switch to only checking prefix.
* Ignores unused function warning.
* Lint fix.
* Switch from unused to deadcode.
* Adds test for isNotRole.
* MM-23881: global drafts endpoints and ws events
Adds endpoints:
- create/update drafts
- delete draft
- get drafts
Adds WS events:
- draft_updated
- draft_created
- draft_deleted
* Ordering and WS event name fixes
* Adds PostID to the drafts table
In the future the drafts will include edited posts, this commit adds the
post id in the combined pkey of the table.
* Fixes route for deleting a thread draft
* Fixes failed checks
* Fixes migrations
* Fixes migration
* Extract translation strings
* Removes PostID since we won't sync editing posts
* Fixes tests
* Fixes i18n
* Update migrations for global drafts
* update branch with latest master changes
* Add feature flag for global drafts
* Set global drafts feature flag default to true
* Added support for files in drafts
* Fix failing i18n check
* Added support for deleting files in drafts
* Revert "Added support for deleting files in drafts"
This reverts commit 45dfd04a760359de2e8814d652c9ef46daf994f6.
* Triggering new test server
* Add config setting 'AllowSyncedDrafts' for syncing drafts with server
* Triggering new test server
* Triggering new test server
* Add guard for config setting and add initial tests
* Fix i18n and lint errors
* Triggering new test server
* Add tests for drafts
* fix lint issues
* Add tests for model/draft
* Triggering new test server
* Triggering new test server
* Trigger new test server
* Address PR comments
* Change left join to regular join in GetDraftsForUser
* Fix broken test
Maybe consider adding an inclDeleted field if we want to get deleted drafts in the future
* fix translations
* Add store tests for drafts
* fix test naming
* remove comment
* update migrations
* set feature flag default to false
* update migrations
Co-authored-by: Mylon Suren <mylonsuren@gmail.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
* MM-46410: adds urgency on mention counts
We have introduced priority for posts in
https://github.com/mattermost/mattermost-webapp/pull/10951.
We do need to color the mention badges in the webapp with a prominent
color when a mention is posted in an urgent message.
A thread has urgent mentions if the root post is marked as urgent, and
the replies contain mentions to the user viewing the thread.
This PR adds two columns, urgentmentioncount, and isurgent, in
channelmembers, and threads tables respectively.
Furthermore when asking for team/thread mention counts, we also return
urgent mention counts for the user.
* Fixes method in tests
* empty commit
* Fixes method call
* Fixes single thread response is_urgent
* Fixes errors
* Fixes mysql migration and adds graphql schema
* Fixes tests
* Refactors IsUrgent and Adds PostsPriority table
Changes:
- removes is_urgent from the threads table
- adds a new table to hold posts priorities
- refactors priority out of the props and into the new table
* Fixes
* Adds translation strings
* Fixes migrations and tests
* Fixes tests
* empty
* Adds Priority to Copy
* empty
* Fixes priority not saved when boards is enabled
We are nilifying Metadata when post.ForPlugin(), which didn't save Priority
for a post when Boards was enabled.
This commit copies metadata again to the post, so metadata are
reinstated.
* Fixes tests
* Adding store tests and fixes syntax error
* Uses threads.ThreadTeamId
* Fixes error
* Adds UrgentMentionCount in graphql api test
* Fetches post priority in batches
* Addresses review comments
* Restore only priority on create post
* Fixes tests
* Nits
* Some refactoring
* Fixes get thread options when post priority enabled
* Adds missing translation
* Use the constant instead of "urgent" string
* Renames urgent constant
* MM-47750: Adds PostAcknowledgements table and apis
- Adds post acknowledgement api/app/store methods to be able to save and
delete post acknowledgements by users.
- Adds wesbsocket events for acknowledgement created/deleted
- Returns post acknowledgements in the post's metadata
* Empty
* Fixes incorrect urgent count when marking a post as unread
* Adds license
* Fixes ACK api, and adds tests
* Fixes vet
* Fixes tests
* Addresses review comments
* Remove unnecessary lines
* Adds config option and changes return of delete ack
* Empty
* Empty
* Enable config by default
* Fixes intl
* Fixes test after setting config default true
* Changes endpoints to PostForUser
* Avoids replica lag
* Fixes error in merge
* Fixes RetryLayer tests due to merge
* Empty
* Empty
* Empty
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
* MM-46410: adds urgency on mention counts
We have introduced priority for posts in
https://github.com/mattermost/mattermost-webapp/pull/10951.
We do need to color the mention badges in the webapp with a prominent
color when a mention is posted in an urgent message.
A thread has urgent mentions if the root post is marked as urgent, and
the replies contain mentions to the user viewing the thread.
This PR adds a column, urgentmentioncount, in channelmembers.
Furthermore when asking for team/thread mention counts, we also return
urgent mention counts for the user.
Adds a new table to hold posts priorities
Refactors priority out of the props and into the new table
We are nilifying Metadata when post.ForPlugin(), which didn't save Priority
for a post when Boards was enabled.
This commit copies metadata again to the post, so metadata are
reinstated.
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Vishal Choudhary <vish9812@gmail.com>