mattermost / mattermost-plugin-google-calendar Goto Github PK
View Code? Open in Web Editor NEWMattermost Google Calendar Plugin
Mattermost Google Calendar Plugin
If you currently have the setting Get Confirmation before changing status
, you get two notifications back to back before any meeting. It would be ideal if these could be condensed into one to reduce the amount of mentions received per meeting (so adding the question of status change to the reminder notification).
Current notifications before the meeting:
Allow the Plugin to use the Custom status and make a meeting with a time from the calendar as the time limit
Having this directly blocking out your time will help with showing availability, having the option to still use away and DND would be good also but having it reflect in the status would be amazing
The current implementation of the /trigger viewcal
and the daily summary show up declined events for Google Calendar. For consistency, we should make it so declined events do not show up in those command results.
/gcal viewcal
will show up only events that are not declined. (Accepted, Tentative, not-answered)We want a bot to post the daily summary of events in a channel. This is basically the same functionality of /calendar summary
, with the output sent to the current channel instead of a direct message. Would a PR for this be welcome?
I think we should add a new command for this, for example /calendar share
or /calendar share-summary
. Is there a better solution?
Then it would be pretty straight forward:
p.CreateBotDMPost(userID, text)
The cron job switch trigger all notifications is only started once when a user connects
. Hence, restarting the plugin also disables notifications.A better way to implement this would be using https://pkg.go.dev/github.com/mattermost/[email protected]/cluster?tab=doc
I have connected my Google account but I am unable to see calendars shared with me.
I hope to be able to see calendars shared with me and create events on them as well
hi, I am getting the following error when executing make
WARN [runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner.
server/plugin.go:15:13: fieldalignment: struct with 72 pointer bytes could be 48 (govet)
type Plugin struct {
^
make: *** [Makefile:47: golangci-lint] Error 1
system:
ubuntu 20.04 lts
$ go version
go version go1.15.5 linux/amd64
golangci-lint version
golangci-lint has version 1.46.2 built from a3336890 on 2022-05-17T11:31:29Z
best, dan
The updateEventsInDatabase()
function could benefit from refactoring. This ticket is a request to create a utility function to share this duplicated code.
Here is the relevant code that needs to be modified:
https://github.com/mattermost/mattermost-plugin-google-calendar/blob/master/server/utils.go#L202
https://github.com/mattermost/mattermost-plugin-google-calendar/blob/master/server/utils.go#L372
If you're interested please comment here and come join our "Contributors" community channel on our daily build server, where you can discuss questions with community members and the Mattermost core team.
New contributors, please see our Developer's Guide and our Plugins Guide.
When using /gcal settings
and clicking one of the options nothing happens. When looking into the Dev Console you can see the following request being responded to with a error 400.
When inspecting the request you can see that the selected_option
is empty.
POST https://mattermost.xxxx.com/api/v4/posts/~redacted~/actions/~redacted~
{"selected_option":""}
The server then responds with:
{
"id": "api.post.do_action.action_integration.app_error",
"message": "Action integration error.",
"detailed_error": "",
"request_id": "<redacted>",
"status_code": 400
}
Server version is 8.1.6
Plugin version is 1.0.1
How to reproduce
gcal connect
gcal settings
Could someone point me to where the code for this functionality lives? I tried looking into it however its not clear to me which part of the code handles this.
Using the [regenerate] button on the encryption key should delete all records from the database since those will be unusable after regeneration.
We should add a disclaimer below the button specifying that all records will be deleted and consequently all users will be disconnected from their google account on the server.
Original issue description:
Using Mattermost 9.2.3 on Oracle Linux 9.1, the Google Calendar plugin keeps on crashing until Mattermost disables it; The error messages all contain "cipher: message authentication failed".
I've tried reinstalling the plugin multiple times, as well as recreating the OAuth tokens, and I've changed the encryption key, so is there anything I'm missing?
The full log for my latest attempt is in this Github gist, but here are the errors sent directly by gcal to the admin account:
(log WARN) Not able to load user 46fpc3eaabd4untu5zaupcnfhy from user index. err=cipher: message authentication failed
(log ERROR) Error renewing subscription. err=It looks like your Mattermost account is not connected to Google Calendar. Please connect your account using /gcal connect.: cipher: message authentication failed
Original issue title: Plugin not working because of cipher errors
Currently the Google Calendar provider doesn't have event notifications enabled, meaning that users and channels won't get notified on event changes.
With the siteURL blank in Mattermost the gcal plugin appears to start, but in fact it crashes.
{"timestamp":"2024-05-01 19:36:14.820 Z","level":"info","msg":"[ERROR] call to OnConfigurationChange failed, error: plugin requires Mattermost Site URL to be set","caller":"io/io.go:429","plugin_id":"com.mattermost.gcal","source":"plugin_stderr"}
{"timestamp":"2024-05-01 19:36:14.820 Z","level":"info","msg":"[ERROR] call to OnConfigurationChange failed, error: plugin requires Mattermost Site URL to be set","plugin_id":"com.mattermost.gcal","source":"plugin_stderr"}
{"timestamp":"2024-05-01 19:36:14.825 Z","level":"debug","msg":"panic: runtime error: invalid memory address or nil pointer dereference","caller":"plugin/hclog_adapter.go:54","plugin_id":"com.mattermost.gcal"}
{"timestamp":"2024-05-01 19:36:14.825 Z","level":"debug","msg":"[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x107af61]","caller":"plugin/hclog_adapter.go:54","plugin_id":"com.mattermost.gcal"}
{"timestamp":"2024-05-01 19:36:14.825 Z","level":"debug","msg":"","caller":"plugin/hclog_adapter.go:54","plugin_id":"com.mattermost.gcal"}
{"timestamp":"2024-05-01 19:36:14.825 Z","level":"debug","msg":"goroutine 42 [running]:","caller":"plugin/hclog_adapter.go:54","plugin_id":"com.mattermost.gcal"}
{"timestamp":"2024-05-01 19:36:14.825 Z","level":"debug","msg":"panic: runtime error: invalid memory address or nil pointer dereference","plugin_id":"com.mattermost.gcal"}
{"timestamp":"2024-05-01 19:36:14.825 Z","level":"debug","msg":"[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x107af61]","plugin_id":"com.mattermost.gcal"}
{"timestamp":"2024-05-01 19:36:14.825 Z","level":"debug","msg":"","plugin_id":"com.mattermost.gcal"}
{"timestamp":"2024-05-01 19:36:14.825 Z","level":"debug","msg":"goroutine 42 [running]:","plugin_id":"com.mattermost.gcal"}
{"timestamp":"2024-05-01 19:36:44.413 Z","level":"debug","msg":"Deactivating plugin due to multiple crashes","id":"com.mattermost.gcal"}
Ideally, you can't even enable to gcal plugin without setting the siteurl
I uploaded the alpha release of the plugin on my mattermost setup , i was able to complete the setup , however when i am using /calendar connect to connect to my calendar , it gets stuck on the sign-on part after asking for permissions (I am allowing them) , what can I do to resolve this issue i am facing.Thanks!!
From 5.24 MM server has a slash command autocomplete functionality feature. An API can be found here
To implement the feature add AutocompleteData
struct to the Command
when registering a slash command.
Similar PRs:
For Todo plugin mattermost-community/mattermost-plugin-todo#69
For Agenda plugin mattermost-community/mattermost-plugin-agenda#40
Looking at the features list, I'm trying to see how to do the second part of this: "Create events directly from a channel, optionally linking them to a channel for reminders"
Specifically, I want the daily reminders to post to a channel where everyone on the server can see it. My org has a shared google account for meetings and this would allow us to mimic the functionality we got out of slack, where we get a daily post of the upcoming meetings for the day.
The plugin should use the cluster-safe jobs implemented here https://github.com/mattermost/mattermost-plugin-api/tree/master/cluster
Since v5.24 slash commands can provide an svg
via AutocompleteIconData
in model.Command
that is then shown in the autocomplete list. This ticket is about adding the icon in assets
to the slash command.
Include screenhots from a dark and a bright theme in the PR description, as there might be the need for a separate icon with a white background for autocomplete.
Similar PRs:
For GitHub plugin mattermost/mattermost-plugin-github#359
For Jira plugin mattermost/mattermost-plugin-jira#653
Mattermost is currently in the process of using golangci-lint
as the default linter for all go projects. mattermost-community/mattermost-plugin-autolink#108 serves as an example of how the migration should look like:
.golangci.yml
from https://github.com/mattermost/mattermost-plugin-autolink/ into this repository.Makefile
from https://github.com/mattermost/mattermost-plugin-autolink/ into this repository.build/
from https://github.com/mattermost/mattermost-plugin-autolink/ into this repository.go mod tidy
and make dist
to ensure the build system works fine.linters-settings.goimports.local-prefixes
to the go module path i.e. to github.com/mattermost/mattermost-plugin-aws-SNS
.make golangci-lint
and fix all issues that arise.Fixing an linter issue is sometimes trivial but can also be quite complicated. There might be cases, where ignoring an issue using issues.exclude-rules
is needed. If you don't know how to resolve an error, please reach out to @hanzei
on the Mattermost Community Server or ask the question here.
I want to install your plugin, but it isn't on Marketplace, so reading the instructions point '7. Upload the plugin to Mattermost...' I can't figure out how, I have no upload button. I am currently on a trial account does this make a difference?
Thank you
Could you provide a built alpha release ?
Thank you.
Using an macBook Air M2, when I try to 'make dist' I get the following error:
npm, gcc and go on newest version
npm WARN deprecated [email protected]: support for ECMAScript is superseded by `uglify-js` as of v3.13.0
npm WARN deprecated [email protected]: Package moved to @redux-devtools/serialize.
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated [email protected]: Package moved to @redux-devtools/instrument.
npm WARN deprecated [email protected]: Package moved to @redux-devtools/app.
npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: 1.x.x versions of the SDK are deprecated. Please upgrade to the latest (2.x.x) version
npm WARN deprecated [email protected]: core-js@<3.4 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated [email protected]: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated @types/[email protected]: This is a stub types definition. history provides its own type definitions, so you do not need this installed.
npm WARN deprecated [email protected]: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
added 1509 packages, and audited 1510 packages in 1m
165 packages are looking for funding
run `npm fund` for details
6 vulnerabilities (1 low, 2 moderate, 1 high, 2 critical)
To address issues that do not require attention, run:
npm audit fix
To address all issues possible (including breaking changes), run:
npm audit fix --force
Some issues need review, and may require choosing
a different dependency.
Run `npm audit` for details.
touch webapp/.npminstall
cd webapp && /opt/homebrew/bin/npm run build;
> build
> webpack --mode=production
assets by status 1.05 KiB [cached] 1 asset
./src/index.tsx 39 bytes [built] [code generated] [1 error]
ERROR in ./src/index.tsx
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:68:19)
at Object.createHash (node:crypto:138:10)
at filename (/Users/michaelklomfass/mattermost-plugin-google-calendar/webapp/node_modules/babel-loader/lib/cache.js:94:23)
at /Users/michaelklomfass/mattermost-plugin-google-calendar/webapp/node_modules/babel-loader/lib/cache.js:120:39
at Generator.next (<anonymous>)
at asyncGeneratorStep (/Users/michaelklomfass/mattermost-plugin-google-calendar/webapp/node_modules/babel-loader/lib/cache.js:3:103)
at _next (/Users/michaelklomfass/mattermost-plugin-google-calendar/webapp/node_modules/babel-loader/lib/cache.js:5:194)
at /Users/michaelklomfass/mattermost-plugin-google-calendar/webapp/node_modules/babel-loader/lib/cache.js:5:364
at new Promise (<anonymous>)
at /Users/michaelklomfass/mattermost-plugin-google-calendar/webapp/node_modules/babel-loader/lib/cache.js:5:97
webpack 5.75.0 compiled with 1 error in 384 ms
make: *** [webapp] Error 1
PR #7 was created to be clear about configuring the plugin properly, as a remedy to avoid a panic in the plugin. The plugin should instead be resilient to this and handle the case of this error. See this comment for details #7 (comment)
There was an index out of range error occurring here:
Maybe adding a custom status, something like ๐๏ธ In a Meeting might be better.
Allow users to answer attendance status of the events directly from event notifications sent in DMs.
Investigate the report of this behaviour using the create event modal:
Information entered in the "Location" field in the Create Calendar Event window in MM is not transferring to the location value in Google Calendar and not showing in the 5-minute reminder.
But entering Location info in the "Description" field will transfer to the Location field in Google Calendar and show up in the 5-minute reminder.
Presently, [1] uses func New(client *http.Client) (*Service, error)
to obtain a new calendar service. The function is deprecated as documented in [2].
Instead, the function func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error)
should be used.
[1] https://github.com/mattermost/mattermost-plugin-google-calendar/blob/master/server/utils.go#L76
[2] https://godoc.org/google.golang.org/api/calendar/v3#New
The ExecuteCommand()
function handles the slash commands for a plugin, with the use of a switch statement
. Currently each case
contains all the logic to handle each slash command. This ticket is a request to modify each case
to return a call to a function which will contain all of the logic. This will make the ExecuteCommand()
function more readable and easy to understand, plus delegate a function to handle each slash command input.
Here is the relevant code that needs to be modified:
https://github.com/mattermost/mattermost-plugin-google-calendar/blob/master/server/command_hooks.go#L83
The https://github.com/mattermost/mattermost-plugin-demo example has an example for the proposed changes.
https://github.com/mattermost/mattermost-plugin-demo/blob/master/server/command_hooks.go#L111
If you're interested please comment here and come join our "Contributors" community channel on our daily build server, where you can discuss questions with community members and the Mattermost core team.
New contributors please see our Developer's Guide and our Plugins Guide.
I installed listed dependencies, then cloned the repository and run command make.
This is the error:
build/deploy/main.go:116:8: undeclared name: `archiver` (typecheck)
err = archiver.Unarchive(bundlePath, targetPath)
^
build/deploy/main.go:12:2: "github.com/mholt/archiver/v3" imported but not used (typecheck)
"github.com/mholt/archiver/v3"
^
server/utils.go:63:54: undeclared name: `calendar` (typecheck)
func (p *Plugin) getCalendarService(userID string) (*calendar.Service, error) {
^
server/utils.go:141:73: undeclared name: `calendar` (typecheck)
func (p *Plugin) updateEventsInDatabase(userID string, changedEvents []*calendar.Event) {
^
server/utils.go:334:57: undeclared name: `calendar` (typecheck)
func (p *Plugin) printEventSummary(userID string, item *calendar.Event) string {
^
server/api.go:53:14: p.API undefined (type *Plugin has no field or method API) (typecheck)
if err := p.API.KVSet(state, []byte(state)); err != nil {
^
server/api.go:89:27: p.API undefined (type *Plugin has no field or method API) (typecheck)
storedState, apiErr := p.API.KVGet(state)
^
server/api.go:100:14: p.API undefined (type *Plugin has no field or method API) (typecheck)
if err := p.API.KVDelete(state); err != nil {
^
server/plugin.go:37:18: p.Helpers undefined (type *Plugin has no field or method Helpers) (typecheck)
botID, err := p.Helpers.EnsureBot(&model.Bot{
^
server/api.go:13:2: "google.golang.org/api/calendar/v3" imported but not used (typecheck)
"google.golang.org/api/calendar/v3"
^
server/command_hooks.go:14:2: "google.golang.org/api/calendar/v3" imported but not used (typecheck)
"google.golang.org/api/calendar/v3"
^
server/utils.go:19:2: "google.golang.org/api/calendar/v3" imported but not used (typecheck)
"google.golang.org/api/calendar/v3"
^
../../../snap/golangci-lint/80/src/runtime/cgo/cgo.go:34:8: could not import C (cgo preprocessing failed) (typecheck)
import "C"
^
make: *** [Makefile:47: golangci-lint] Error 1
The create event modal uses simple <select/>
elements to select the time of the event. <input/>
elements can be of type time
which will leave the implementation to the browser with an already defined UI and they also allow for a min
/max
/step
parameters to customize the options.
input[type="time"]
date
field:
The current version sends out a reminder 5 minutes before an event. My workplace is currently needing to modify this by hand to be 1 minute before as a reminder, since some people have a tendency to be focused and forget while they do something else during that 5 minute window.
Ideally, though, this could be customizable per user. And maybe a user could get multiple reminders.
For example, I'd prefer 5 minute reminders to 1 minute reminders (but management wants 1m). But if I could get both 5m and 1m reminders, that would be even better (for me)! But I suspect most of my coworkers would only want one reminder, not multiple.
For simplicity, this could be specified by user as something like 1|5|10
or 10
or 1|5
with a single text box.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.