[Bug] Side menu is available also in Android App #413

Open
opened 2025-04-17 09:53:08 +02:00 by llaumgui · 11 comments

Environment

  • Custom menu version: 5.0.1
  • Nextcloud version: 31
  • PHP version: 8.4
  • Web server (Nginx, Apache2): Apache2
  • Web browser and version (Firefox 80, Google Chrome 74, etc): Android

Configuration

{
  "add-logo-link": true,
  "always-displayed": true,
  "apps-categories-custom": {
    "files": null,
    "contacts": null,
    "calendar": null,
    "deck": null,
    "notes": null,
    "tables": null,
    "analytics": null,
    "passwords": null,
    "memories": null,
    "repod": null,
    "collectives": null,
    "bookmarks": null,
    "cookbook": null,
    "dashboard": null,
    "activity": null,
    "otpmanager": null
  },
  "apps-order": [
    "dashboard",
    "files",
    "activity",
    "photos",
    "memories",
    "contacts",
    "calendar",
    "collectives",
    "deck",
    "notes",
    "tables",
    "analytics",
    "bookmarks",
    "repod",
    "cookbook",
    "passwords",
    "otpmanager"
  ],
  "background-color": "#607d8b",
  "background-color-opacity": 93,
  "background-color-to": "#607d8b",
  "big-menu": false,
  "big-menu-hidden-apps": [
    "0",
    "photos"
  ],
  "categories-custom": [],
  "categories-order": [
    "other",
    "office",
    "external_links",
    "files",
    "workflow",
    "integration",
    "games",
    "multimedia",
    "organization",
    "tools",
    "customization",
    "search",
    "social",
    "monitoring",
    "security",
    "dashboard"
  ],
  "categories-order-type": "custom",
  "current-app-background-color": "#7f97a2",
  "dark-mode-background-color": "#607d8b",
  "dark-mode-background-color-opacity": 100,
  "dark-mode-background-color-to": "#7f97a2",
  "dark-mode-current-app-background-color": "#7f97a2",
  "dark-mode-icon-invert-filter": 0,
  "dark-mode-icon-opacity": 100,
  "dark-mode-loader-color": "#3584e4",
  "dark-mode-opener": "side-menu-opener",
  "dark-mode-text-color": "#ffffff",
  "default-enabled": true,
  "display-logo": true,
  "external-sites-in-top-menu": false,
  "force": true,
  "force-light-icon": false,
  "icon-invert-filter": 0,
  "icon-opacity": 100,
  "loader-color": "#3584e4",
  "loader-enabled": true,
  "opener": "side-menu-opener",
  "opener-hover": true,
  "opener-only": false,
  "opener-position": "before",
  "show-settings": true,
  "side-with-categories": false,
  "size-icon": "normal",
  "size-text": "normal",
  "target-blank-apps": [],
  "text-color": "#ffffff",
  "top-menu-apps": [],
  "top-menu-mouse-over-hidden-label": 0,
  "top-side-menu-apps": [],
  "use-avatar": false
}

Steps to reproduce

Open Memories App (https://play.google.com/store/apps/details?id=gallery.memories&hl=fr).

Observed Results

Side menu is visible. I thinks that the Android App is a webapp.

Expected Results

No side menu on Android (web)App.

More informations

See screenshot.

### Environment * Custom menu version: 5.0.1 * Nextcloud version: 31 * PHP version: 8.4 * Web server (Nginx, Apache2): Apache2 * Web browser and version (Firefox 80, Google Chrome 74, etc): Android ### Configuration ``` { "add-logo-link": true, "always-displayed": true, "apps-categories-custom": { "files": null, "contacts": null, "calendar": null, "deck": null, "notes": null, "tables": null, "analytics": null, "passwords": null, "memories": null, "repod": null, "collectives": null, "bookmarks": null, "cookbook": null, "dashboard": null, "activity": null, "otpmanager": null }, "apps-order": [ "dashboard", "files", "activity", "photos", "memories", "contacts", "calendar", "collectives", "deck", "notes", "tables", "analytics", "bookmarks", "repod", "cookbook", "passwords", "otpmanager" ], "background-color": "#607d8b", "background-color-opacity": 93, "background-color-to": "#607d8b", "big-menu": false, "big-menu-hidden-apps": [ "0", "photos" ], "categories-custom": [], "categories-order": [ "other", "office", "external_links", "files", "workflow", "integration", "games", "multimedia", "organization", "tools", "customization", "search", "social", "monitoring", "security", "dashboard" ], "categories-order-type": "custom", "current-app-background-color": "#7f97a2", "dark-mode-background-color": "#607d8b", "dark-mode-background-color-opacity": 100, "dark-mode-background-color-to": "#7f97a2", "dark-mode-current-app-background-color": "#7f97a2", "dark-mode-icon-invert-filter": 0, "dark-mode-icon-opacity": 100, "dark-mode-loader-color": "#3584e4", "dark-mode-opener": "side-menu-opener", "dark-mode-text-color": "#ffffff", "default-enabled": true, "display-logo": true, "external-sites-in-top-menu": false, "force": true, "force-light-icon": false, "icon-invert-filter": 0, "icon-opacity": 100, "loader-color": "#3584e4", "loader-enabled": true, "opener": "side-menu-opener", "opener-hover": true, "opener-only": false, "opener-position": "before", "show-settings": true, "side-with-categories": false, "size-icon": "normal", "size-text": "normal", "target-blank-apps": [], "text-color": "#ffffff", "top-menu-apps": [], "top-menu-mouse-over-hidden-label": 0, "top-side-menu-apps": [], "use-avatar": false } ``` ### Steps to reproduce Open Memories App (https://play.google.com/store/apps/details?id=gallery.memories&hl=fr). ### Observed Results Side menu is visible. I thinks that the Android App is a webapp. ### Expected Results No side menu on Android (web)App. ### More informations See screenshot.
Owner

Hello!

Did you have this behaviour with Custom Menu 4.x ?

Hello! Did you have this behaviour with Custom Menu 4.x ?
Author

Yes. Since 4.x.

Yes. Since 4.x.
deblan reopened this issue 2025-04-18 10:36:24 +02:00
Owner

Fixed in v5.0.2!

Fixed in v5.0.2!
deblan 2025-04-29 19:34:14 +02:00
Author

I'm on version 5.0.2. I've force-closed Memories and cleared the cache of the Android app, but I still see the menu. The HTTPD logs show the correct user agent:

172.25.0.7 - - [30/Apr/2025:06:45:38 +0000] "GET /apps/memories/api/days/xxx HTTP/1.1" 200 778 "https://xxx.xxx.xxx/apps/memories/" "MemoriesNative/1.12 Mozilla/5.0 (Linux; Android 10) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.5672.76 Mobile Safari/537.36"

I'm on version 5.0.2. I've force-closed Memories and cleared the cache of the Android app, but I still see the menu. The HTTPD logs show the correct user agent: 172.25.0.7 - - [30/Apr/2025:06:45:38 +0000] "GET /apps/memories/api/days/xxx HTTP/1.1" 200 778 "https://xxx.xxx.xxx/apps/memories/" "MemoriesNative/1.12 Mozilla/5.0 (Linux; Android 10) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.5672.76 Mobile Safari/537.36"
deblan reopened this issue 2025-04-30 08:51:42 +02:00
Author

OK, in my Nextcloud logs:

Undefined array key "HTTP_USER_AGENT" at /var/www/apps/side_menu/lib/AppInfo/Application.php#109

I think that HTTP_USER_AGENT is not part of $_SERVER in PHP-FPM

OK, in my Nextcloud logs: `Undefined array key "HTTP_USER_AGENT" at /var/www/apps/side_menu/lib/AppInfo/Application.php#109 ` I think that HTTP_USER_AGENT is not part of $_SERVER in PHP-FPM
Author

Hum..... If put var_dump($_SERVER); to the top of index.php, I see a HTTP_USER_AGENT...

Hum..... If put `var_dump($_SERVER);` to the top of index.php, I see a HTTP_USER_AGENT...
Owner

On my lab, I installed Memories and configurred my locale instance of nextcloud (behind Apache2 and PHP-FPM). I reproduced your issue until the fix.

On my lab, I installed Memories and configurred my locale instance of nextcloud (behind Apache2 and PHP-FPM). I reproduced your issue until the fix.
Owner

The version 5.0.3 check if $_SERVER["HTTP_USER_AGENT"] exists before using it but I don't know why it couldn't exist in this place.

The version 5.0.3 check if `$_SERVER["HTTP_USER_AGENT"]` exists before using it but I don't know why it couldn't exist in this place.
Author

I propose a PR with the use of Request Object. The Request Object have the content of HTTP_USER_AGENT... But menu still present on the App.... Perhaps a cache issue...

I propose a PR with the use of Request Object. The Request Object have the content of HTTP_USER_AGENT... But menu still present on the App.... Perhaps a cache issue...
Owner

Thanks for you PR!

Thanks for you PR!
Owner

The modifications are available in v5.1.0

The modifications are available in v5.1.0
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
deblan/side_menu#413
No description provided.