Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send comment bug #478

Closed
jio3252 opened this issue Jan 1, 2019 · 15 comments
Closed

Send comment bug #478

jio3252 opened this issue Jan 1, 2019 · 15 comments
Labels
Milestone

Comments

@jio3252
Copy link

jio3252 commented Jan 1, 2019

What is going wrong?

When sending a comment on a poll, the arrow button just spinns indefinitely.
The comment is send though.

To Reproduce
Steps to reproduce the behavior:

  1. Create new poll
  2. Write a comment (as guest or registered user)
  3. Press on the arrow to send the comment
  4. See error

Expected behavior
After sending a comment, the comment should appear.

Screenshots
comment

Information about your polls installation

Current version

Fresh installation or update from a prior version (from which one)?
Fresh installation

How did you install this version?(Appstore or describe installation)
Appstore

Information about your Instance of Nextcloud/ownCloud

Nextcloud 15

Which Version?
15.0.10

List of activated apps:
Default apps plus Calender and Polls

Server configuration

Operating system:
Debian stretch

Web server:
apache

Database:
Mariadb

Client configuration

Device:
Desktop

Browser:
Firefox 64

Operating system:
Win 10

@dartcafe
Copy link
Collaborator

dartcafe commented Jan 3, 2019

It is somehow strange. I don't have this issue. Like #461. Seems to be the same effect.

@jio3252
Copy link
Author

jio3252 commented Jan 6, 2019

I just setup a new local nexcloud server and the issue reappeared.

@jio3252
Copy link
Author

jio3252 commented Jan 6, 2019

Also tested possible differences between Firefox and Chromium. The issue appears in both cases.

@jio3252
Copy link
Author

jio3252 commented Jan 7, 2019

To reproduce the issue, you can use the following docker compose file:

create "docker-compose.yml" with the following

version: '2'

volumes:
nextcloud:
db:

services:
db:
image: mariadb
restart: always
volumes:
- db:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=test123
- MYSQL_PASSWORD=test123
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud

app:
image: nextcloud
ports:
- 80:80
links:
- db
volumes:
- nextcloud:/var/www/html
restart: always

install and run "docker-compose up"

Connect to your ip in Browser.

@v1r0x
Copy link
Collaborator

v1r0x commented Jan 7, 2019

Is there an error in your browser's console? or nextcloud.log?

@jio3252
Copy link
Author

jio3252 commented Jan 7, 2019

Is there an error in your browser's console? or nextcloud.log?

Nice hint, found the error:

EvalError: call to Function() blocked by CSP

Its the Content Security Policy

Since the docker setup enables this protection and nextcloud itself works just fine, it is probably an issue of poll. Is there a way for nextcloud apps to whitelist this?

@v1r0x
Copy link
Collaborator

v1r0x commented Jan 8, 2019

Is there some more information where this happens? E.g. line number, file name, ...

It is (at least around NC 10/11) possible to whitelist certain functions/types in the CSP. To whitelist them, I need the type (image-src, script-src, ...) of the blocked content. Thus, I need some more information about the error.

Thanks for investigating!

@dartcafe
Copy link
Collaborator

dartcafe commented Jan 8, 2019

I get these messages on another firefox instance and with chrome:

The entered message got saved and I see it after a reload.

EvalError: call to Function() blocked by CSP core.js:552:26865
	createFunctionContext https://nextcloud.yagst.de/core/vendor/core.js:552:26865
	compile https://nextcloud.yagst.de/core/vendor/core.js:552:25477
	d https://nextcloud.yagst.de/core/vendor/core.js:552:15946
	e https://nextcloud.yagst.de/core/vendor/core.js:552:16019
	<anonym> https://nextcloud.yagst.de/apps/polls/js/vote.js:232:28
	j https://nextcloud.yagst.de/core/vendor/core.js:2:26920
	fireWith https://nextcloud.yagst.de/core/vendor/core.js:2:27738
	x https://nextcloud.yagst.de/core/vendor/core.js:4:11251
	b/< https://nextcloud.yagst.de/core/vendor/core.js:4:14765

and
Content Security Policy: Die Einstellungen der Seite haben das Laden einer Ressource auf eval blockiert ("script-src"). core.js:552:26864

@v1r0x
Copy link
Collaborator

v1r0x commented Jan 8, 2019

Can't find use of eval in the code. Only in create-poll.js. Looks like an external component/script uses eval

@dartcafe
Copy link
Collaborator

dartcafe commented Jan 8, 2019

Seems, that this error only occurs on public pages. I suspect the avatar... But this is just a guess.

@dartcafe
Copy link
Collaborator

dartcafe commented Jan 8, 2019

Recall: happens also when logged in.

@dartcafe
Copy link
Collaborator

dartcafe commented Jan 8, 2019

Output from chrome's console:

core.js?v=e934ec74-2:552 Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'nonce-R3R[...]FBldz0='".

    at e.Function (<anonymous>)
    at e.createFunctionContext (core.js?v=e934ec74-2:552)
    at e.compile (core.js?v=e934ec74-2:552)
    at d (core.js?v=e934ec74-2:552)
    at e (core.js?v=e934ec74-2:552)
    at Object.success (vote.js?v=e934ec74-2:232)
    at j (core.js?v=e934ec74-2:2)
    at Object.fireWith [as resolveWith] (core.js?v=e934ec74-2:2)
    at x (core.js?v=e934ec74-2:4)
    at XMLHttpRequest.<anonymous> (core.js?v=e934ec74-2:4)
createFunctionContext @ core.js?v=e934ec74-2:552
compile @ core.js?v=e934ec74-2:552
d @ core.js?v=e934ec74-2:552
e @ core.js?v=e934ec74-2:552
(anonymous) @ vote.js?v=e934ec74-2:232
j @ core.js?v=e934ec74-2:2
fireWith @ core.js?v=e934ec74-2:2
x @ core.js?v=e934ec74-2:4
(anonymous) @ core.js?v=e934ec74-2:4
load (async)
send @ core.js?v=e934ec74-2:4
ajax @ core.js?v=e934ec74-2:4
n.(anonymous function) @ core.js?v=e934ec74-2:4
(anonymous) @ vote.js?v=e934ec74-2:231
dispatch @ core.js?v=e934ec74-2:3
r.handle @ core.js?v=e934ec74-2:3

@dartcafe
Copy link
Collaborator

dartcafe commented Jan 8, 2019

On debugging, the error is thrown after executing this line

}).error(function () {

@dartcafe
Copy link
Collaborator

dartcafe commented Jan 8, 2019

Seems to be a problem in using handlebars.
After removing

$('#no-comments').after(tmpl_comment(data));

the CSP error does not occur anymore (besides, that the comment is not inserted visually).

@dartcafe
Copy link
Collaborator

dartcafe commented Jan 8, 2019

replacing hte line with

$('#no-comments').after(
	'<li class="comment flex-column"> ' +
	'<div class="authorRow user-cell flex-row"> ' +
	'<div class="avatar missing" title="' + data.userId + '"></div> ' +
	'<div class="author">' + data.displayName + '</div>' +
	'<div class="date has-tooltip live-relative-timestamp datespan" data-timestamp="' + data.timeStamp + '" title="' + data.date + '">' + data.relativeNow + '</div>' +
	'</div>' +
	'<div class="message wordwrap comment-content">' + data.comment + '</div>' +
	'</li>'
);

works. Not beautiful, but a quick fix before the vue migration.

dartcafe added a commit that referenced this issue Jan 9, 2019
@dartcafe dartcafe mentioned this issue Jan 9, 2019
dartcafe added a commit that referenced this issue Jan 9, 2019
@dartcafe dartcafe added this to the 0.10.0 milestone Feb 10, 2019
dartcafe added a commit that referenced this issue Jul 31, 2019
* Change actions in vote page
#420

* Switched disallow maybe to allow.

* fixed width on date poll cells

* Refactoring ApiController

* Update lib/Controller/ApiController.php

Co-Authored-By: dartcafe <[email protected]>

* Set 1 to default in allow_maybe because of existing polls

* Revert accidentally included desing tests.

* Fix adding allow_maybe upon migration from prior version.

* Last CSS fix

* Update max-version to current dev version 16

Signed-off-by: Jan-Christoph Borchardt <[email protected]>

* allow option and update packages

* Update CHANGELOG.md

* [tx-robot] updated from transifex

* [tx-robot] updated from transifex

* [tx-robot] updated from transifex

* poll width

* [tx-robot] updated from transifex

* Increase version for fix.

* [tx-robot] updated from transifex

* [tx-robot] updated from transifex

* Fix migration to handle problem after migration error

* fix link to create poll on empty main site

* [tx-robot] updated from transifex

* fix color variable name in list.scss

Hi, I noticed the variable name --text-maxcontrast has been used. This variable hasn't actually been defined anywhere, so I have changed it to the variable name used by nextcloud server.

* Fix broken migration after orphaned votes

* #454 fix PostgeSQL with workaround

* Changed QueryBuilder where

* [tx-robot] updated from transifex

* [tx-robot] updated from transifex

* [tx-robot] updated from transifex

* [tx-robot] updated from transifex

* [tx-robot] updated from transifex

* fix #464

* Refactoring ApiController

* Update lib/Controller/ApiController.php

Co-Authored-By: dartcafe <[email protected]>

* allow option and update packages

* recompile

* Updated comments

* Cleanup

* Code tidy

* Finally

* Some more scutinizer fixes

* Some scrutinizer fixes

* Fixing more scutinizer hints

* Some afterwork

* Optimization

* Grammar

* compile buuild

* Update OptionMapperTest.php

* Test

* Split api and system controller

* more refactoring

* fix [no ci]

* Progress

* remove test strings

* Update christophwurst/nextcloud requirement from ^12.0 to ^15.0

Updates the requirements on [christophwurst/nextcloud](https://github.com/ChristophWurst/nextcloud_composer) to permit the latest version.
- [Release notes](https://github.com/ChristophWurst/nextcloud_composer/releases)
- [Commits](https://github.com/ChristophWurst/nextcloud_composer/commits/v15.0.0)

Signed-off-by: dependabot[bot] <[email protected]>

* Update axios requirement from ^0.17.1 to ^0.18.0

Updates the requirements on [axios](https://github.com/axios/axios) to permit the latest version.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/master/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/commits/v0.18.0)

Signed-off-by: dependabot[bot] <[email protected]>

* Update file-loader requirement from ^1.1.6 to ^2.0.0

Updates the requirements on [file-loader](https://github.com/webpack-contrib/file-loader) to permit the latest version.
- [Release notes](https://github.com/webpack-contrib/file-loader/releases)
- [Changelog](https://github.com/webpack-contrib/file-loader/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack-contrib/file-loader/commits/v2.0.0)

Signed-off-by: dependabot[bot] <[email protected]>

* Update vue-loader requirement from ^13.7.3 to ^15.4.2

Updates the requirements on [vue-loader](https://github.com/vuejs/vue-loader) to permit the latest version.
- [Release notes](https://github.com/vuejs/vue-loader/releases)
- [Changelog](https://github.com/vuejs/vue-loader/blob/master/CHANGELOG.md)
- [Commits](https://github.com/vuejs/vue-loader/commits)

Signed-off-by: dependabot[bot] <[email protected]>

* Design updates

* Update webpack requirement from ^3.12.0 to ^4.28.3

Updates the requirements on [webpack](https://github.com/webpack/webpack) to permit the latest version.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/commits/v4.28.3)

Signed-off-by: dependabot[bot] <[email protected]>

* [tx-robot] updated from transifex

* Update file-loader requirement from ^2.0.0 to ^3.0.1

Updates the requirements on [file-loader](https://github.com/webpack-contrib/file-loader) to permit the latest version.
- [Release notes](https://github.com/webpack-contrib/file-loader/releases)
- [Changelog](https://github.com/webpack-contrib/file-loader/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack-contrib/file-loader/commits/v3.0.1)

Signed-off-by: dependabot[bot] <[email protected]>

* Update environment

* change file structure and js/vue code style

* lint:fix

* move .jshintrc

* Revert "move .jshintrc"

This reverts commit 30ff56c.

* Trying to get scrutinizer quiet

* Updates env

* Made a detour to rename files from lower case to camel case on windows

* typo fix

* appstore fix

* fine tuning

* final changes

* chmod -x to sone files

* rearrange Makefile

* [tx-robot] updated from transifex

* Update README.md

* Initial

* [tx-robot] updated from transifex

* Fix #478

* progress

* Added PopoverMenu, VueClipboard, vClickOutside

* Added removing polls
Vue app is now index of app

* [tx-robot] updated from transifex

* Added modal confirmation dialog
Added comment counter
Added voting indicator

* [tx-robot] updated from transifex

* [tx-robot] updated from transifex

* Update nextcloud-vue requirement from ^0.4.6 to ^0.6.0

Updates the requirements on [nextcloud-vue](https://github.com/nextcloud/vue-components) to permit the latest version.
- [Release notes](https://github.com/nextcloud/vue-components/releases)
- [Commits](https://github.com/nextcloud/vue-components/commits/v0.6.0)

Signed-off-by: dependabot[bot] <[email protected]>

* [tx-robot] updated from transifex

* fix build
grey icons

* design update

* Fix comment counter

* Added CSRF condition on writing functions
Changes to API Calls

* Some updates

* fix test

* Update composer.json

* fix invalid create button after validation #498

* Update overview screenshot

* bring back admin edit to menu

* Added clone polls

* Removed logging

* Little optimisation and tidy

* Shift all dates of a date poll with given step and unit

* Updates

* removed some obsolete files and functions.

* Progress

* remove test strings

* Update version and readme

* Added function to popovermenu

* Updated screenshots

* quick fix for  votes without click. #479

* [tx-robot] updated from transifex

* [tx-robot] updated from transifex

* display access with icon instead of text #497

* Changed list order

* fix query params in eventmapper

* fix double closing bracket

* tidy css

* reduce icon size

* [tx-robot] updated from transifex

* [tx-robot] updated from transifex

* [tx-robot] updated from transifex

* [tx-robot] updated from transifex

* forgotten commit

* fix expire date could not be created/edited (#461)

* #511 - added missing access check

* Updated change log

* Update screenshot

* Updated screenshots

* [tx-robot] updated from transifex

* [tx-robot] updated from transifex

* Update vue-clipboard2 requirement from ^0.2.1 to ^0.3.0

Updates the requirements on [vue-clipboard2](https://github.com/Inndy/vue-clipboard2) to permit the latest version.
- [Release notes](https://github.com/Inndy/vue-clipboard2/releases)
- [Changelog](https://github.com/Inndy/vue-clipboard2/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Inndy/vue-clipboard2/commits/v0.3.0)

Signed-off-by: dependabot[bot] <[email protected]>

* Remove sourcemaps from production build

* [tx-robot] updated from transifex

* [tx-robot] updated from transifex

* resize type icons

* [tx-robot] updated from transifex

* Update nextcloud-vue requirement from ^0.6.0 to ^0.7.0

Updates the requirements on [nextcloud-vue](https://github.com/nextcloud/nextcloud-vue) to permit the latest version.
- [Release notes](https://github.com/nextcloud/nextcloud-vue/releases)
- [Commits](nextcloud-libraries/nextcloud-vue@v0.6.0...v0.7.0)

Signed-off-by: dependabot[bot] <[email protected]>

* fix and beautitfy

* Update CHANGELOG.md

* HTML and CSS tidy on list page

* Change overflow-x of table element

* Update build system
+ [email protected]
+ @babel/[email protected]
+ [email protected]
+ [email protected]
+ [email protected]
+ @babel/[email protected]
+ [email protected]
+ [email protected]
+ [email protected]
+ [email protected]
+ [email protected]
+ [email protected]
+ [email protected]

* Update nextcloud-vue requirement from ^0.7.0 to ^0.8.0

Updates the requirements on [nextcloud-vue](https://github.com/nextcloud/nextcloud-vue) to permit the latest version.
- [Release notes](https://github.com/nextcloud/nextcloud-vue/releases)
- [Commits](nextcloud-libraries/nextcloud-vue@v0.7.0...v0.8.0)

Signed-off-by: dependabot[bot] <[email protected]>

* [tx-robot] updated from transifex

* Update nextcloud-vue 0.8.0

* use min-height to garantee display of popovermenu

* Update version info and changelog

* Added tooltips

* late delivery

* updated translation

* lint fixes

* [tx-robot] updated from transifex

* [tx-robot] updated from transifex

* [tx-robot] updated from transifex

* Translators hints

* Repckaging for #532
- [ ] Update date in CHANGELOG.md before release

* IE11 hint

* [tx-robot] updated from transifex

* [tx-robot] updated from transifex

* [tx-robot] updated from transifex

* Update nextcloud-vue requirement from ^0.8.0 to ^0.9.0

Updates the requirements on [nextcloud-vue](https://github.com/nextcloud/nextcloud-vue) to permit the latest version.
- [Release notes](https://github.com/nextcloud/nextcloud-vue/releases)
- [Commits](nextcloud-libraries/nextcloud-vue@v0.8.0...v0.9.0)

Signed-off-by: dependabot[bot] <[email protected]>

* [tx-robot] updated from transifex

* [tx-robot] updated from transifex

* [tx-robot] updated from transifex

* add release date

* [tx-robot] updated from transifex

* [tx-robot] updated from transifex

* Refactoring models

* Update

* Moving from depricated OCP\AppFramework\Db\Mapper to OCP\AppFramework\Db\QBMapper 
Removing unused functions

* Deleted too much

* [tx-robot] updated from transifex

* [tx-robot] updated from transifex

* [tx-robot] updated from transifex

* [tx-robot] updated from transifex

* [tx-robot] updated from transifex

* [tx-robot] updated from transifex

* [tx-robot] updated from transifex

* [tx-robot] updated from transifex

* [tx-robot] updated from transifex

* [tx-robot] updated from transifex

* [tx-robot] updated from transifex

* [tx-robot] updated from transifex

* [tx-robot] updated from transifex

* [tx-robot] updated from transifex

* Update nextcloud-axios requirement from ^0.1.3 to ^0.2.0

Updates the requirements on [nextcloud-axios](https://github.com/ChristophWurst/nextcloud-axios) to permit the latest version.
- [Release notes](https://github.com/ChristophWurst/nextcloud-axios/releases)
- [Commits](nextcloud-libraries/nextcloud-axios@v0.1.3...v0.2.0)

* Updated version and dependencies

* [tx-robot] updated from transifex

* [tx-robot] updated from transifex

* [tx-robot] updated from transifex

* Fixed typo

Reported at Transifex. See https://www.transifex.com/nextcloud/nextcloud/translate/#lt_LT/polls/129942219

Signed-off-by: Mark Ziegler <[email protected]>

* [tx-robot] updated from transifex

* [tx-robot] updated from transifex

* [tx-robot] updated from transifex

* [tx-robot] updated from transifex

* [tx-robot] updated from transifex

* [tx-robot] updated from transifex

* [tx-robot] updated from transifex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants