Cannot snooze a reminder from a recurring schedule
Summary
The snooze drop-down does nothing if the reminder is a recurring one.
Steps to reproduce
- Issue a command such as
/remind me FOOBAR every day at <2 minutes from your current time> - Wait for reminder message
- Try to select snooze option from message
Expected behaviour
That instance of the reminder should be snoozed
Observed behaviour (that appears unintentional)
Nothing happens, message remains.
Server configuration
Operating system: Debian
Mattermost version: Community 5.18.1
Remind version: 0.4.4
Updated from an older Remind bot version or fresh install: Updated
Mattermost server logs
{"level":"error","ts":1580428486.372024,"caller":"mlog/log.go:174","msg":"Plugin failed to ServeHTTP, RPC call failed","plugin_id":"com.github.scottleedavis.mattermost-plugin-remind","error":"unexpected EOF"}
Additional context
See comments here.
@hanzei Plugin failed to ServeHTTP, RPC call failed...
perhaps handleSnooze
https://github.com/scottleedavis/mattermost-plugin-remind/blob/master/server/http.go#L342
Also, if multiple snooze attempts are made to a recurring reminder, the plugin will crash and have to be disabled & re-enabled from the System Console, otherwise it won't respond to any slash commands.
I thought of a possible solution for this issue. Because snoozing only applies to the current instance of the recurring reminder, but (I'm guessing) the data model doesn't have a record of instances, snoozing could:
- clone the original reminder
- drop the clone's recurring schedule and set its date & time to the original's + the snooze duration
- dismiss the original as if it had been marked as completed
It's a little hackish, but likely easier to implement than something that requires changing the model. A consequence would be that deleting a clone would not delete the original schedule, which I see as a positive. I'd be happy with that over plugin crashes.