GithubHelp home page GithubHelp logo

mattermost-plugin-msteams-sync's Introduction

Mattermost MS Teams Sync Plugin

Table of Contents

License

See the LICENSE file for license rights and limitations.

Overview

This plugin integrates MS Teams with Mattermost by providing automated syncing of messages from Mattermost to MS Teams and vice versa. For a stable production release, please download the latest version from the Plugin Marketplace and follow the instructions to install and configure the plugin. If you are a developer who wants to work on this plugin, please switch to the Developer docs.

Features

This plugin supports the following features:

  • Connect to MS Teams account using the OAuth2 flow.

  • Link Mattermost channels with MS Teams channels and sync messages between the linked channels.

  • Link Mattermost DMs and group messages with Teams chats and sync messages.

  • Sync Mattermost and MS Teams messages for any changes made in any existing messages on either side.

  • Deletion of MS Teams messages is synced with Mattermost but it's not vice versa.

  • Sync posts containing markdown and attachments.

    image image image image

  • Sync reactions on posts.

Installation

  1. Go to the releases page of this GitHub repository and download the latest release for your Mattermost server.
  2. Upload this file on the Mattermost System Console > Plugins > Management page to install the plugin. To learn more about how to upload a plugin, see the documentation.
  3. Enable the plugin from System Console > Plugins > MSTeams Sync.

Setup

Connecting to MS Teams

There are two methods by which you can connect your Mattermost account to your MS Teams account.

  • Using slash command

    • Run the slash command /msteams-sync connect in any channel.

    • You will get an ephemeral message from the MS Teams bot containing a link to connect your account.

    • Click on that link. If it asks for login, enter your Microsoft credentials to connect your account.

  • Using the button in the full screen modal

    • If the setting "Enforce connected accounts" is enabled in the plugin's config settings, then a full screen modal appears that looks like this -

    image

    • Click on the "Connect account" button.

    • A window appears containing a link to connect your account.

    • Open that link. If it asks for login, enter your Microsoft credentials to connect your account.

  • Connecting the bot account

    • Run the slash command /msteams-sync connect-bot in any channel.
    • This command is visible and accessible by system admins only.
    • After running the slash command, you will get an ephemeral message from the MS Teams bot containing a link to connect your account.
    • Click on that link. If it asks for login, enter your Microsoft credentials to connect your account.
    • Refer here for more details on connecting the bot account.
  • FAQs

    • Read about the FAQs here

mattermost-plugin-msteams-sync's People

Contributors

ayusht2810 avatar gijsdb avatar jespino avatar lieut-data avatar manojmalik20 avatar nityanand13 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mattermost-plugin-msteams-sync's Issues

Refactor the handler.go file

Refactor the handler.go file. It has been growing organically and it needs to be in better shape to integrate the sync concept.

Complete thread gets deleted on MM on deleting reply on Teams

If the user deletes any reply message of any desired message on Teams, the complete thread gets deleted on MM.

Steps to reproduce:-

  1. Start any new conversation on Teams through the text message.
  2. Add any reply to that particular text message.
  3. Delete that particular reply message.

The complete thread gets deleted on MM.

Subscriptions are not being created/renewed properly

After two channels are linked, messages are synced between MM and Teams with no issues. If we leave the system idle for few minutes, the messages from Teams to MM stop syncing. The following error was shown in the server logs:

Unable to create the new subscription         caller="app/plugin_api.go:976" plugin_id=com.mattermost.msteams-sync error="503 Service Unavailable: {"error":{"code":"UnknownError","message":"","innerError":{"client-request-id":"da925406-c994-4c23-ac2f-7fd5de6df45c","date":"2023-04-04T10:15:27","request-id":"da925406-c994-4c23-ac2f-7fd5de6df45c"}}}"
error [2023-04-04 15:45:27.287 +05:30] Unable to subscribe to channels               caller="app/plugin_api.go:976" plugin_id=com.mattermost.msteams-sync error="503 Service Unavailable: {"error":{"code":"UnknownError","message":"","innerError":{"client-request-id":"da925406-c994-4c23-ac2f-7fd5de6df45c","date":"2023-04-04T10:15:27","request-id":"da925406-c994-4c23-ac2f-7fd5de6df45c"}}}"

After this error, even if we unlink the channels and link again, the subscription will not be created and the messages from Teams will not be synced to Mattermost.

Messages edited on Teams are not reflected on MM.

When any desired message is edited on Teams, the same is not reflected in MM channel.

Steps to reproduce:-

  1. Enter any desired text message on Teams.
  2. Verify it once on linked channel in MM.
  3. Go back to the Teams channel and edit the same message.
  4. Verify the same message on MM channel.

The message edited is not visible on MM channel.

image

image

Also, if user tries to edit a message on MM which was originally sent through Teams, it is not getting reflected on Teams and vice-versa.

Improve the user sync

Improve the user sync using subscriptions and sync on restart or subscription failure.

Message received from system not synced properly

When the user receives any message in a channel in MM from system, it is shown as given by the user in Teams.

Steps to reproduce:-

  1. Do any message through which the system responds.(for example, add any new member in channel)
  2. Go to the linked channel in Teams.

The response received from system will be shown as received from any user in Teams.

image (2)

image

Only single updated reaction visible on Teams

Despite of multiple reactions added by the user on any desired message on MM, only the last added reaction is visible on that particular message on Teams.

Steps to reproduce:-

  1. Add any desired reaction to the message in MM.
  2. Add second desired reaction to the same message in MM.
  3. Verify the same reactions on Teams.

Only the last added reaction would be presented to the user on Teams.

Messages not visible on Teams if the user is not connected

If any desired user is not connected to Teams, the messages done by that particular user on Mm are not visible on Teams. But opposite of this is true(if a user do a message on Teams and the user is not connected, still the messages are visible on MM channel.)

Steps to reproduce:-

  1. Add any test message on MM channel by the user who is not connected to Teams.
  2. Verify the same message on Teams.

The message done by the user who is not connected is not visible on the Teams channel.

image

image

Reactions not in sync on MM with Teams

Reactions added on Teams are not visible on MM.

Steps to reproduce:-

  1. Go to Teams linked channel.
  2. Add any reaction on the desired message.
  3. Go to the channel linked in MM.

The reaction added are not visible in MM channel.

image
image (1)

Subscriptions not working properly

Subscriptions for messages on Teams to be shown on MM are not working properly. Once the plugin is restarted and user is connected again along with linking the channel again is making the subscriptions to work properly.

Subscriptions are not being renewed

After linking two channels, the syncing of messages from Mattermost to Teams works fine but the messages from Teams to Mattermost work only for 10 minutes. After that we get the following error in the console -

{"timestamp":"2023-03-22 13:30:19.127 Z","level":"error","msg":"Unable to refresh the subscription","caller":"app/plugin_api.go:976","plugin_id":"com.mattermost.msteams-sync","error":"404 Not Found: {\"error\":{\"code\":\"ResourceNotFound\",\"message\":\"The object was not found.\",\"innerError\":{\"client-request-id\":\"b4af97b8-8b26-4886-86dd-f07c7831546d\",\"date\":\"2023-03-22T13:30:19\",\"request-id\":\"b4af97b8-8b26-4886-86dd-f07c7831546d\"}}}","subscriptionID":"201ca758-82eb-4f0d-85f3-37b051df5b93"}
{"timestamp":"2023-03-22 13:30:20.023 Z","level":"error","msg":"Unable to refresh the subscription","caller":"app/plugin_api.go:976","plugin_id":"com.mattermost.msteams-sync","error":"404 Not Found: {\"error\":{\"code\":\"ResourceNotFound\",\"message\":\"The object was not found.\",\"innerError\":{\"client-request-id\":\"dbd49c56-c0cf-4baf-b12c-b85b48693f43\",\"date\":\"2023-03-22T13:30:20\",\"request-id\":\"dbd49c56-c0cf-4baf-b12c-b85b48693f43\"}}}","subscriptionID":"9d54db16-82ad-4afd-8581-af9bcdcbfcc0"}

Messages are still visible for users who are not in the linked MM channel but are in the Teams channel

If a user is NOT a member of the linked channel in MM, but IS a member of the linked channel in Teams, then the message sent by that particular user through Teams is visible in MM channel. Also, on hovering the profile pop-up is also visible for that particular user.

Steps to reproduce:-

  1. Do any desired message through Teams by the user who is not a member of MM channel.
  2. Verify it on MM channel.

image

image

image

image

Weird error shown to user on not connecting to Teams

If the user generates the access token to link his account to Teams, and no step is taken further to connect by the user, after a certain period of time, a weird error is presented to the user.

Steps to reproduce:-

  1. Run the connect slash command.
  2. Do not open the link presented to the user.
  3. Wait for a certain amount of time(likely to be 10-15 minutes).

A weird error occurs on screen.
image

Also, if the user is already connected, and on running the connect slash command, sometimes another weird error is presented to the user. The steps to reproduce this issue are also the same as given above.
image

Plugin doesn't work with MySQL

When this plugin is run on a Mattermost server using MySQL, it fails to start and gives the following errors -

msg":"Unable to restart plugin on upgrade.","caller":"web/context.go:105","path":"/api/v4/plugins","request_id":"debfczthcpbm5b9ph6npr5q8ir","ip_addr":"172.31.1.8","user_id":"zz8ghn1gdibhfjtrbyiwqqueor","method":"POST","err_where":"installExtractedPlugin","http_code":500,"err_details":"Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'PRIMARY KEY, mmTeamID VARCHAR, msTeamsChannelID VARCHAR, msTeamsTeamID VARCHAR)' at line 1"

No way for user to disconnect account

After connecting a Mattermost account to MS Teams account, there is no way to disconnect the account even if the config setting for "Enforce connected accounts" is disabled.

Expected

If the config setting Enforce connected accounts is disabled, then there should be a slash command so that a user can disconnect his account.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.