polls icon indicating copy to clipboard operation
polls copied to clipboard

Opening public shared link when logged in results in empty content

Open mfuerni opened this issue 2 months ago • 7 comments

⚠️ This issue respects the following points: ⚠️

  • [x] This is a bug, not a question or a configuration/webserver/proxy issue.
  • [x] This issue is not already reported on Github (I've searched it).
  • [x] I agree to follow Nextcloud's Code of Conduct.

What went wrong, what did you observe?

Assume the following scenario:

  • There are two Nextcloud users A and B
  • User A shares a poll with a public link
  • User B is logged in and opens the public link (/apps/polls/s/abc123DE)

Then a redirect to /apps/polls/vote/12 happens and the div with ID content-vue stays empty. The user B sees just the header navigation bar and the background image.

The developer console does not show an error. The div#content renders as follows:

<div id="content" class="app-polls" data-v-app="">
  <div data-v-d9b0d7e8="" id="content-vue" class="content app-polls transitions-active">
    <!---->
    <!---->
    <!---->
    <!---->
  </div>
</div>

What did you expect, how polls should behave instead?

The user should see the poll and be able to choose the desired options.

What steps does it need to replay this bug?

  1. Share a poll with a public link.
  2. Access the public link while being logged in as same or a different user.

Affected polls version

8.5.0

Installation method

Installed/updated from the appstore (Apps section of your site)

Installation type

First time installation

Can you rule out that any extension you use is involved in the issue?

  • [x] I have checked all browser extension

Which browser did you use, when experiencing the bug?

  • [x] Firefox
  • [x] Chrome
  • [x] Chromium/Chromium based (i.e. Edge)
  • [ ] Safari
  • [ ] Other/Don't know

Other browser

No response

Add your browser log here


Additional client environment information

No response

NC version

Nextcloud 31

Other Nextcloud version

No response

PHP engine version

PHP 8.3

Other PHP version

No response

Database engine

PostgreSQL

Database Engine version or other Database

No response

Which user-backends are you using?

  • [x] Default user-backend (database)
  • [ ] LDAP/ Active Directory
  • [ ] SSO - SAML
  • [ ] Other/Don't know

Add your nextcloud server log here


Additional environment informations

Nextcloud AIO

Configuration report

{
    "system": {
        "one-click-instance": true,
        "one-click-instance.user-limit": 100,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "check_data_directory_permissions": false,
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "password": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost",
            "***REMOVED SENSITIVE VALUE***"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "version": "31.0.10.2",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "maintenance": false,
        "updatechecker": false,
        "loglevel": 2,
        "log_type": "file",
        "logfile": "\/var\/www\/html\/data\/nextcloud.log",
        "log_rotate_size": 10485760,
        "log.condition": {
            "apps": [
                "admin_audit"
            ]
        },
        "preview_max_x": 2048,
        "preview_max_y": 2048,
        "jpeg_quality": 60,
        "enabledPreviewProviders": {
            "1": "OC\\Preview\\Image",
            "2": "OC\\Preview\\MarkDown",
            "3": "OC\\Preview\\MP3",
            "4": "OC\\Preview\\TXT",
            "5": "OC\\Preview\\OpenDocument",
            "6": "OC\\Preview\\Movie",
            "7": "OC\\Preview\\Krita",
            "0": "OC\\Preview\\Imaginary",
            "23": "OC\\Preview\\ImaginaryPDF"
        },
        "enable_previews": true,
        "upgrade.disable-web": true,
        "mail_smtpmode": "smtp",
        "trashbin_retention_obligation": "auto, 30",
        "versions_retention_obligation": "auto, 30",
        "activity_expire_days": 30,
        "simpleSignUpLink.shown": false,
        "share_folder": "\/Shared",
        "one-click-instance.link": "https:\/\/nextcloud.com\/all-in-one\/",
        "upgrade.cli-upgrade-link": "https:\/\/github.com\/nextcloud\/all-in-one\/discussions\/2726",
        "updatedirectory": "\/nc-updater",
        "maintenance_window_start": 100,
        "allow_local_remote_servers": true,
        "davstorage.request_timeout": 3600,
        "documentation_url.server_logs": "https:\/\/github.com\/nextcloud\/all-in-one\/discussions\/5425",
        "htaccess.RewriteBase": "\/",
        "dbpersistent": false,
        "auth.bruteforce.protection.enabled": true,
        "ratelimit.protection.enabled": true,
        "files_external_allow_create_new_local": false,
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "preview_imaginary_url": "***REMOVED SENSITIVE VALUE***",
        "preview_imaginary_key": "***REMOVED SENSITIVE VALUE***",
        "DOMAIN": "***REMOVED SENSITIVE VALUE***""
    }
}

List of activated Apps

Enabled:
  - activity: 4.0.0
  - admin_audit: 1.21.0
  - bruteforcesettings: 4.0.0
  - circles: 31.0.0
  - cloud_federation_api: 1.14.0
  - comments: 1.21.0
  - contactsinteraction: 1.12.1
  - dav: 1.33.0
  - deck: 1.15.4
  - federatedfilesharing: 1.21.0
  - files: 2.3.1
  - files_downloadactivity: 1.18.1
  - files_downloadlimit: 4.0.0
  - files_fulltextsearch: 31.0.0
  - files_pdfviewer: 4.0.0
  - files_reminders: 1.4.0
  - files_sharing: 1.23.1
  - files_trashbin: 1.21.0
  - files_versions: 1.24.0
  - forms: 5.2.2
  - fulltextsearch: 31.0.0
  - fulltextsearch_elasticsearch: 31.0.0
  - groupfolders: 19.1.9
  - logreader: 4.0.0
  - lookup_server_connector: 1.19.0
  - nextcloud-aio: 0.8.0
  - notes: 4.12.3
  - notifications: 4.0.0
  - notify_push: 1.2.1
  - oauth2: 1.19.1
  - photos: 4.0.0
  - polls: 8.5.0
  - privacy: 3.0.0
  - profile: 1.0.0
  - provisioning_api: 1.21.0
  - recommendations: 4.0.0
  - related_resources: 2.0.0
  - richdocuments: 8.7.6
  - serverinfo: 3.0.0
  - settings: 1.14.0
  - sharebymail: 1.21.0
  - support: 3.0.0
  - systemtags: 1.21.1
  - tasks: 0.17.1
  - text: 5.0.2
  - theming: 2.6.1
  - twofactor_backupcodes: 1.20.0
  - twofactor_totp: 13.0.0-dev.0
  - updatenotification: 1.21.0
  - viewer: 4.0.0
  - webhook_listeners: 1.2.0
  - whiteboard: 1.4.1
  - workflowengine: 2.13.0
Disabled:
  - app_api: 5.0.2 (installed 5.0.2)
  - calendar: 5.5.9 (installed 5.5.9)
  - contacts: 7.3.6 (installed 7.3.6)
  - dashboard: 7.11.0 (installed 7.11.0)
  - encryption: 2.19.0
  - federation: 1.21.0 (installed 1.21.0)
  - files_external: 1.23.0
  - firstrunwizard: 4.0.0 (installed 4.0.0)
  - nextcloud_announcements: 3.0.0 (installed 3.0.0)
  - password_policy: 3.0.0 (installed 3.0.0)
  - survey_client: 3.0.0 (installed 3.0.0)
  - suspicious_login: 9.0.1
  - twofactor_nextcloud_notification: 5.0.0
  - user_ldap: 1.22.0
  - user_status: 1.11.0 (installed 1.11.0)
  - viewer.bak: 4.0.0
  - weather_status: 1.11.0 (installed 1.11.0)

Nextcloud Signing status

No errors have been found.

Additional Information

Worked in v8.4.6. For now, I downgraded to it.

mfuerni avatar Nov 12 '25 03:11 mfuerni

That is still a caching issue. Updated code is not loaded properly.

dartcafe avatar Nov 16 '25 10:11 dartcafe

That is still a caching issue. Updated code is not loaded properly.

What kind of cache do you mean? Client-side or server-side cache?

I reproduced it on a freshly installed Nextcloud AIO instance and using separate browsers for the two users. Are you sure this is a caching issue?

mfuerni avatar Nov 16 '25 11:11 mfuerni

I see this behavior after a new fresh build and a loaded app. A refresh fixes this usually. I just tried to reproduce, but no luck. The poll got loaded.

Private poll and another user got the private link. After using he got a personal share and redirected to the poll, which loaded properly.

To be honest, it is 8.6.0-dev version. But the last fixes regarding shares were applied before the last release AFAIR.

dartcafe avatar Nov 17 '25 06:11 dartcafe

We can also observe the very same behavior described in 1st post.

But this is not always reproducible : I mean, in 20 logged-in users opening a public Poll, maybe 13 will see the Poll, the other 7 only the top menu and a blank page. 😿

That is still a caching issue. Updated code is not loaded properly.

Browser caches have been emptied, and also OPcache/Redis caches on server.

solracsf avatar Nov 28 '25 09:11 solracsf

Something happens inside the app. The routing behaves strange. I have situations where I am in a poll and want to route to the polls list. But instead of routing to the list I stay inside the vote view and an illegal, empty poll gets loaded.

I have to inspect it further. Maybe I messed up something inside the router.

dartcafe avatar Nov 30 '25 17:11 dartcafe

@dartcafe could this have been a side effect of https://github.com/nextcloud/server/issues/56789 (fixed by https://github.com/nextcloud/server/pull/56926) or completely unrelated ?

Edit: I'm on v31 on patch seems for v32 only, so it seems unrelated...

solracsf avatar Dec 10 '25 17:12 solracsf

I am not using memcache and am able to experience a similar issue (or maybe the same). So I think, it is not related.

Currently low on time, so no further progress atm. Sorry.

dartcafe avatar Dec 11 '25 11:12 dartcafe

This issue drove me crazy. I am pretty sure, you are facing the same issue I had under different circumstances.

The main entry file (the main script file) loaded inside the template has a static name and is usually cached by the browser. After a version update the file is updated, but the browser is still thinking, it is identically to the cached script file.

But the dynamically loaded chunks get updated names and so the old main script still wants to load the old chunks, which do not exist anymore.

I added a prefix, which matches the version of polls, so the main script should be loaded properly.

At least the problem I had is solved by this.

As soon, as I have finished fixing public registration (another annoying topic) version 8.6.0 will be released.

dartcafe avatar Dec 16 '25 21:12 dartcafe

Thank you @dartcafe for taking a look into this issue. But I cannot imagine how the fix you described would help here. Your fix is important, as soon as the content of a static file changes, it should have a different name to prevent caching problems. But we cleared browser caches or used fresh instances.

@solracsf wrote in https://github.com/nextcloud/polls/issues/4379#issuecomment-3588508291

Browser caches have been emptied, and also OPcache/Redis caches on server.

I used a fresh instance (so nothing for the hostname in browser cache) and used the browser in private/incognito mode. So the browser cache should not be a problem.

When I first open a publicly shared poll as logged in user, then a redirect to /apps/polls/vote/12 happens and nothing is shown. But there is a row added to the database table oc_polls_share with type user. If I remember correctly, when the user opens the public link the second time, it works. But if I remove the row from database table again, it stops working until, during the next time the user opens the share-link, a new row is added to the database table for the current user and shared poll.

Maybe this helps in digging further into the issue.

mfuerni avatar Dec 17 '25 04:12 mfuerni

Did you already apply the update to v8.6.0?

Additionally some fixes were applied to the registration process (which here also plays).

Just did a quick check and no prob. Internal user used a public link to a private poll. Redirect to the vote page with no problem.

dartcafe avatar Dec 17 '25 06:12 dartcafe