johndoh / roundcube-taskwatermark

Replaces the static watermark template used by the core with a task aware page with tips for the user on what to do (eg. Select a message to read). It also adds an option to always select the first message in the mail list when Roundcube is opened or the folder changed.
https://plugins.roundcube.net/#/packages/johndoh/taskwatermark
6 stars 1 forks source link

Issue on mobile (Firefox Android) #4

Open melroy89 opened 6 months ago

melroy89 commented 6 months ago

When using taskwatermark plugin in Roundcube (I use it together with other plugins for full transparency: jqueryui, zipdownload, swip and contextmenu). I notice an issue with this plugin on mobile.

I'm using Firefox on mobile, it will show the watermark by default. Pressing back to menu and/or getting an overview for all emails is not working on Firefox (Android).

Removing this plugin from my server solved all the issues again on mobile.

johndoh commented 6 months ago

What skin are you using? Also, is it only the mail task that is affected, for example if you go to Contacts does the same thing happen?

I can't immediately recrete the issue and there is nothing in the plugin which changes the focus so I'm trying to get some more clues.

Pressing back to menu and/or getting an overview for all emails is not working

Any chance of a screenshot?

melroy89 commented 6 months ago

Default skin.

I will try to enable it again try to reproduce the problem. With screenshots and alike.

johndoh commented 6 months ago

If possible please also try and recreate it using Firefox on desktop with a small window. The reason for this is that on desktop you can check the browser JS console for errors.

melroy89 commented 6 months ago

I can't replicate it on the desktop.

I can however replicate the problem under mobile (Firefox), but only if I close Firefox. Under Android you can show the running apps and close the app by swiping up. I try to screen record the problem, see below.

Then I use to open the Roundcube web mail from the start screen (I created a shortcut to my domain where I host Roundcube). After that, I login, so this is a new session. This will now trigger the issue I try to describe within this ticket. Trying to press the back button after Roundcube dump me into this watermark screen on mobile. Pressing back won't work...

Sorry, I did need to add Mosaic/blur to some of the content shown on screen, due to the sensitivity of the content/data. I hope you understand.

https://github.com/johndoh/roundcube-taskwatermark/assets/628926/d7f00aa9-b597-4c44-a561-3dc578076c2e

johndoh commented 6 months ago

Thank you for the video this helps me a lot. I can see the watermark is being shown before your message list has loaded. That combined with your description makes me think that Firefox is automatically restoring your last session and somehow that's causing the problem. Can we explore that possibility a bit please?

) Does the behavior change if you sign out of Roundcube before closing Firefox? ) Please confirm the URL you use in your shortcut links to the root of your Roundcube installation only? *) If put Firefox into private mode and then go to Roundcube and login does it still happen?

I think its your browser that is causing the behavior rather than the plugin although that doesn't explain why the default watermark is not shown with the plugin is disabled. So the last thing would be some strange thing with the display_first setting. The JS for this setting does not trigger until after the message list has finished loading and in your video it shows what ever is happening happens before that so that is confusing.

melroy89 commented 6 months ago

Ps. I explicit set display_first setting off. $config['display_first'] = false;. This should be the default setting I think, but anyways.

I will test the 3 bullet points now first. I will let you know soon.

melroy89 commented 6 months ago

In some cases it automatically opens the first email instead of showing me the inbox actually (or this watermark message). Which is also WRONG (in all cases it's wrong). I never configured to show the first email (as I said I disabled this by default).

But 80% of the time it ends-up at this watermark message. It only opens up the first email, when I go again to <domain.com> without the additional query parameters in the address bar) and without closing Firefox. If I close Firefox it will go to the watermark message 100% of the time.

*) Does the behavior change if you sign out of Roundcube before closing Firefox?

I'm unable to sign out, since I can't access the menu. As you saw in the video, the back button won't work. With that I also can't access the menu. And without that I can't press the sign out button.

So I can't sign out, unless I remove the plugin. If I remove the plugin, then I don't test your plugin behavior anymore. So chicken, egg issue here.

*) Please confirm the URL you use in your shortcut links to the root of your Roundcube installation only?

Yes it seems it uses the root URL (so just.. https://domain-where-roundcube-is.com), which then redirect automatically to https://<domain.com>/?_task=mail&_mbox=INBOX).

*) If put Firefox into private mode and then go to Roundcube and login does it still happen?

In private mode Roundcube also trips hard. It goes from inbox to watermark to showing me the first email. Pressing back, goes to watermark message again. Pressing back again will again not work. Just like before.


Bonus: I disabled the plugin first! If I go to https://domain.com/?_task=settings&_action=preferences then the settings page load (nothing strange right?). Then I enable your plugin and refresh the settings menu (so the same URL). I got the same issue with going to the watermark message, unable to go back.... Roundcube just dumps me back to the watermark message again, making it unable to use Roundcube.

See this video: https://youtube.com/shorts/tyJ6vw39ke8?feature=share (for 1 second the menu seeeems to stay open, but then it again closes again)


Here are all the configs in Roundcube, if you own an Android device you are maybe able to reproduce the problem in Firefox yourself:

// check client IP in session authorization
$config['ip_check'] = true;

$config['des_key'] = 'SECRET :)';

// Cache settings
// Use these hosts for accessing Redis.
$config['redis_hosts'] = 'unix:///var/run/redis/redis-server.sock';

// GUI settings
// default messages sort column.
$config['message_sort_col'] = 'date';

// default messages sort order
$config['message_sort_order'] = 'DESC';

// ----------------------------------
// PLUGINS
// ----------------------------------
// List of active plugins (in plugins/ directory)
$config['plugins'] = [
        'additional_message_headers',
        'archive',
        'attachment_reminder',
        'managesieve',
        'markasjunk',
        'emoticons',
        'enigma',
        'password',
        'jqueryui',
        'zipdownload',
        'swipe',
        'contextmenu',
        'taskwatermark',
];

// Swipe config
$config['swipe_actions'] = [
  'messagelist' => [
    'left' => 'delete',
    'right' => 'markasjunk',
    'down' => 'checkmail'
  ],
  'contactlist' => [
    'left' => 'swipe-select',
    'right' => 'compose',
    'down' => 'none'
  ]
];

// taskwatermark don't select first message
$config['display_first'] = false;

// Make use of the built-in spell checker.
$config['enable_spellcheck'] = true;

$config['enable_installer'] = false;

// Enable HTML editor by default
$config['htmleditor'] = 1;
johndoh commented 6 months ago

In some cases it automatically opens the first email instead of showing me the inbox actually (or this watermark message). Which is also WRONG (in all cases it's wrong). I never configured to show the first email (as I said I disabled this by default).

User level settings can override whats in config.inc.php, have a look at Preferences > Displaying Messages > Always open the first message in the list. In the first video you posted of the mail screen the fact the 'Click here to always open the first message in the list' line is not shown means the setting must be true. May you accidentally hit the link one time and it enabled it in the user settings. Or may be its another clue!

Try as I might I still can't recreate it. Its something specific to Firefox on your mobile because you said its fine on desktop the device makes no difference to the code, its screen size that counts.

The only thing left I can think of is if you can poke around in the layout_init() function in ui.js that is part of the Elastic skin. May be then you can find out why the content frame is being shown by default? Even if I force that to show the content frame I still don't get the same behavior you have described.

Also, and this is a real leap but..... you requested a new 'hold to select" feature in the Swipe plugin. I guess this was before you enabled this plugin but you do also have the Contextmenu plugin enabled and with that enabled then holding on a message should bring up the context menu, it does for me with Android Firefox. If it doesn't do that for you then may be thats another clue. Like something is messing with the JS generally.

melroy89 commented 6 months ago

Try as I might I still can't recreate it. Its something specific to Firefox on your mobile because you said its fine on desktop the device makes no difference to the code, its screen size that counts.

It seems like that yes.