mantisbt-plugins / Announce

Announcements plugin for MantisBT, lets privileged accounts create and post announcements that can be shown to users on a global or per-project basis, and allow users to dismiss individual messages.
MIT License
20 stars 14 forks source link

Time to Live does not work #16

Closed atrol closed 6 years ago

atrol commented 6 years ago

Message does not disappear after waiting the configured number of seconds

Using current master branch of Mantis

Error in browser console

[Error] Announcement dismissal failed – {error: SyntaxError: JSON Parse error: Unexpected EOF, request: "xmlhttprequest.php?entrypoint=plugin_announce_dismiss&context_id=2"}
{error: SyntaxError: JSON Parse error: Unexpected EOF, request: "xmlhttprequest.php?entrypoint=plugin_announce_dismiss&context_id=2"}Object
    error (plugin_file.php:50)
    i (jquery-2.2.4.min.js:2:27157)
    fireWith (jquery-2.2.4.min.js:2:27916)
    z (jquery-2.2.4.min.js:4:12095)
    (anonyme Funktion) (jquery-2.2.4.min.js:4:15621)
dregad commented 6 years ago

@atrol I'm not able to reproduce the error you reported.

Tested on my Ubuntu 16.04 dev box with latest master branch HEADs (mantisbt/mantisbt@750c311b972bd1d90ae1c64a577217d861cd3af5, 8fa0004b04a942daf0f2307c0c26003c92fe7370), using both Firefox 52.0.2 [1] and Chrome 61.0.3163.100.

[1] I know my FF is a bit outdated but newer versions are not compatible with some plugins I rely on.

atrol commented 6 years ago

I found it happens just if you set TTL seconds and uncheck Dismissable

dregad commented 6 years ago

Ah yes that makes sense, I didn't think of this scenario. I can reproduce the error now.